#include<bits/stdc++.h>
using namespace std;
#define pi cos(-1)
char s[111111];
int main()
{
int ans=0;
while(scanf("%s",s)!=EOF) {
for(int i=0;i<strlen(s);i++)
if(s[i]>='A'&&s[i]<='Z') {
s[i]=s[i]-('A'-'a');
}
int tt;
while(strstr(s,"doge")!=0) {
tt=strstr(s,"doge")-s;
for(int i=tt;i<=tt+3;i++)
s[i]='X';
ans++;
}
}
cout << ans << endl;
}