char s[50010],c[12],*p;r; main(m){ gets(s); scanf("%d ",&m); for(;m--;){ gets(c); for(p=s;p=strstr(p,c);++p)++r; } printf("%d",r); return 0; }