#include <iostream>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <string>
#include <strings.h>
#include <vector>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <stdio.h>

#define fori(I) for (int i = 0; i < I; i++)
#define forj(J) for (int j = 0; j < J; j++)
#define min(a,b) (a>b?b:a)
#define max(a,b) (a>b?a:b)

using namespace std;

int main() {

    ifstream in ("DATA5.txt");  //DID YOU FIX THIS?
    ofstream out ("OUT5.txt");  //DID YOU FIX THIS?
   /*
    for(int z=0;z<5;z++){
        int num;
        in >> num;
        char c[6];
        int tot=0;
        fori(num){
           forj(5){
                    in.getline(c,6);
                    if(c[0] == '\0' || c[0] == '\r') {
                        break;     
                    }
                    //in >> c;
                    for(int f=0; f<strlen(c); f++) {
                        if(c[f] == '#') {
                            tot++;
                        }
                    }
                    cout << c << " "<< tot<< endl;    
            }
        }
        //cout << tot << endl;
        int ans = ceil((float)tot/25);
        //if((tot/25)*25 != tot) tot/25 + 1;
        cout << ans << endl;
    }
*/
    for (int z = 0; z < 5; z++) {
        int tot = 0;
        string line;
        getline(in,line);
        while (1) {
            getline(in,line);
            for (int i = 0; i < line.length(); i++) {
                if (line[i] == '#') tot++;
            }
            char next = in.peek();
            if (in.fail() || (next >= '0' && next <= '9')) {
                break;
            }
        }
        //cout << tot << endl;
        int ans = ceil((float)tot/25);
        out << ans << endl;
    }

    return 0;
}

