#include<bits/stdc++.h>
using namespace std;
int counter(string ar)
{
int l, i, c = 0;
l = ar.size();
for(i=0;i<l;i++)
{
if(ar[i] != 'X')
c++;
}
return c;
}
int main()
{
int n, i;
vector<string>an;
string ch;
while(cin >> n && n != 0)
{
getchar();
int l, m = 26;
for(i=1;i<=n;i++)
{
getline(cin, ch);
l = counter(ch);
if(m > l)
m = l;
an.push_back(ch);
}
int d = 0;
for(i=0;i<an.size();i++)
{
int c = counter(an[i]);
d += c - m;
}
cout << d << endl;
an.clear();
}
return 0;
}
using namespace std;
int counter(string ar)
{
int l, i, c = 0;
l = ar.size();
for(i=0;i<l;i++)
{
if(ar[i] != 'X')
c++;
}
return c;
}
int main()
{
int n, i;
vector<string>an;
string ch;
while(cin >> n && n != 0)
{
getchar();
int l, m = 26;
for(i=1;i<=n;i++)
{
getline(cin, ch);
l = counter(ch);
if(m > l)
m = l;
an.push_back(ch);
}
int d = 0;
for(i=0;i<an.size();i++)
{
int c = counter(an[i]);
d += c - m;
}
cout << d << endl;
an.clear();
}
return 0;
}
Comments
Post a Comment