Enclosed Area Calculator
This tool is designed to count the enclosed areas in uppercase, lowercase, and numbers. Use a space to seperate the groupings. This tool gives you the option of showing your "4" to be closed or open so make sure to select that below.
Also, beware that some scripts have extra loops that this tool will not count such as a "g". If your data has these extra enclosed areas, modify the output for that section to include the extra count.
Click here for an example.