[Solved] algorithm for finding the number of 1s in a matrix (only vertical 1s). The image is self explanatory that what i exactly want

algorithm for finding the number of 1s in a matrix (only vertical 1s). The image is self explanatory that what i exactly want solved algorithm for finding the number of 1s in a matrix (only vertical 1s). The image is self explanatory that what i exactly want