#include #include int main(void){ int i, n = 0; char S[1000001], s[4]; s[4] = '\0'; scanf("%s", S); for(i = 0; S[i+3] != '\0'; i++){ s[0] = S[i]; s[1] = S[i+1]; s[2] = S[i+2]; s[3] = S[i+3]; if(strcmp(s, "tree") == 0) n++; } printf("%d\n", n); return 0; }