ANT hung a banner for the first programming contest it ever held.

Hyeokjin took an image processing course last semester and wants to put what he learned to use, so he is writing a program that counts how many letters the banner holds.
First he applied a filter that turns every part of the banner that belongs to a letter into 1 and every other part into 0.
Looking only at those values, he decided that whenever cells holding 1 touch each other up, down, left, right, or diagonally, the whole connected blob is one letter. In other words, the neighbors of a cell are the eight cells around it.
Given the values Hyeokjin produced with his filter, print how many letters his program counts.