Cod sursa(job #997451)
#include <stdio.h>
#include <string.h>
using namespace std;
char S[1000005];
int LEN,NRLIT,NRCUV;
int main()
{
freopen ("text.in","r",stdin);
freopen ("text.out","w",stdout);
fgets(S,1000005,stdin);
LEN=strlen(S);
int i;
for (i=0;i<LEN;i++)
{
if ((S[i]>='a' && S[i]<='z') || (S[i]>='A' && S[i]<='Z'))
NRLIT++;
if (((S[i]>='a' && S[i]<='z') || (S[i]>='A' && S[i]<='Z')) && (S[i+1]==' ' || S[i+1]=='\n' || S[i+1]=='.' || S[i+1]=='!' || S[i+1]=='?' || S[i+1]==','))
NRCUV++;
}
printf("%d\n",NRLIT/(NRCUV+1));
fclose(stdin);
fclose(stdout);
return 0;
}