print(sum('#'==open('/dev/stdin').readlines()[i][(i*3)%31] for i in range(323)))