Sanket is MEME-GOD of Nirma and he likes to make memes of different people. He recently made a meme of Shaili.
He got this meme printed on the paper and took it with him to the college to show it to his classmates. Somehow Shaili found out this and she got angry. She cut down this meme into pieces and just left them on the floor when Sanket was not in the classroom. After coming back to the class, Sanket found out all the pieces scattered on the floor. The floor is N*M grid with all 0 s.
Sanket wants to stick those pieces together but for that he needs to find total number of pieces in which the meme was cut down first. For this he wants your help. Find total number of pieces into which the meme was cut down. All connected cells which contain a part of a meme are to be considered as a single piece of a meme.
A cell with entry 1 indicates that it contains a part of the meme. Two cells are said to be connected if and only if they share an edge.
NOTE : A cell with coordinate(x,y) is connected to cells with coordinates (x+1,y) ,(x,y+1), (x,y-1), (x-1,y).
Input Format:
First line contains two integer N and M, Total number of rows and columns of the floor respectively.
Next N lines contains a string of length M with 0s and 1s. 0 indicates an empty cell and 1 indicates a cell with a part of meme.
Output Format:
Print a single Integer, Total number of pieces into which the meme was cut down.
Constraints:
1<=N,M<=1000
Different pieces of meme: First Piece : (1,1), (1,2) ,(1,3) Second Piece : (3,1), (3,2)