Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input()
- def f(d):
- c=0
- for i in range(1,len(d)):
- if d[i]!=d[i-1]:
- c+=1
- r=c//2
- if c is 1:
- if d[0] is 'm':
- return 0
- else:
- return 1
- return r
- print(f(input()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement