#include <iostream>
#include <fstream>
#include <math.h>
#include <string>
using namespace std;

int main()
{

	ifstream fin("data1.txt");  // ("data [problem number].txt")
	ofstream fout("out1.txt"); // ("out [problem number].txt")

	int x,z,a,keys[8];
	string line;

	for (x=1;x<=5;x++)
	{
	
		for (z=1;z<=7;z++)
		{
			keys[z]=0;
			fin>>line;
			for (a=0;a<line.length();a++)
			{
				if (line[a]=='#')
					keys[z]=keys[z]+1;
			}
			
			
		}
		for (z=1;z<=7;z++)
			fout<<keys[z];
		fout<<endl;
				fin.ignore();

	}

	return 0;
}
