v[50],c,p;f(X){for(;c<X;c+=v[p++]);c=50*(c-X);printf(":%d\n",c);}main(n){for(s;c=n=atoi(gets(v));printf("%d\n",s)){for(p=s=0;p<n;v[++p]=strlen(gets(v+n)));for(;c;)c=0,p=++s,f(5),f(7),f(5),f(7),f(7);}
}