import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;


public class Problem_1 {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		File input = new File ("DATA1.txt");
		Scanner in = new Scanner(input);
		String[] teeth = new String[40];
		String[] length = new String[30]; int len = 0; int y = 0;
		int count = 0;
		for (int c=0;c<(20);c++){
			length[c] = "";
		}
		for (int x=0;x<(39);x++){
			count = count + 1;
			teeth[x] = in.nextLine();
			if(count % 8 == 0){
			y = y + 1;
			}
			else{
			
			String s =  teeth[x];
			length[y] = length[y] +((s.lastIndexOf('#')+1)); 
			}
		}
		File file = new File ("OUT1.txt");
		
		FileWriter fw = new FileWriter (file);
		for (int a=0;a<(y+1);a++){
		
		fw.write(length[a]+"\r\n");
		
		System.out.println(length[a]);
	}
		fw.close();
	}
}
