SHARE
TWEET

Untitled

a guest Oct 21st, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input()
  2. def f(d):
  3.     c=0
  4.     for i in range(1,len(d)):
  5.         if d[i]!=d[i-1]:
  6.             c+=1
  7.     r=c//2
  8.     if c is 1:
  9.         if d[0] is 'm':
  10.             return 0
  11.         else:
  12.             return 1
  13.     return r
  14.  
  15. print(f(input()))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top