Count the number of subtasks, which are open (in status category To Do or In Progress).
A valid configuration for this Calculated Text Field:
Math expression: count(filterByPredicate(subtasks(), ^%{00144} = "To Do" OR ^%{00144} = "In Progress"))
Note that:
Once configured and added to an issue screen, the result will look like this: