s=0 for v in raw_input().split("= "):s+=len(v)/6-1;print s