#include <bits/stdc++.h>
using namespace std;
char s[900][900];
int a, b;
int main () {
cin >> a >> b;
for (int i=1; i<=a; i++) {
    for (int j=1; j<=b; j++) {
        cin >> s[i][j];
    }
}
cout << (a+b)/4+10  << endl;


return 0;
}