Problem:
 Score : 300 points    Problem Statement Two foxes Jiro and Saburo are playing a game called 1D Reversi . This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a new stone to either end of the row. Similarly to the original game of Reversi, when a white stone is placed, all black stones between the new white stone and another white stone, turn into white stones, and vice versa.  In the middle of a game, something came up and Saburo has to leave the game. The state of the board at this point is described by a string S . There are |S| (the length of S ) stones on the board, and each character in S represents the color of the i -th ( 1 ≦ i ≦ |S| ) stone from the left. If the i -th character in S is B , it means that the color of the corresponding stone on the board is black. Similarly, if the i -th character in S is W , it means that the color of the corresponding stone is white.  Jiro wants all stones on the board to be of the same color. For this purpose, he will place new stones on the board according to the rules. Find the minimum number of new stones that he needs to place.      Constraints  1 ≦ |S| ≦ 10^5  Each character in S is B or W .         Input The input is given from Standard Input in the following format:  S       Output Print the minimum number of new stones that Jiro needs to place for his purpose.        Sample Input 1 BBBWW      Sample Output 1 1  By placing a new black stone to the right end of the row of stones, all white stones will become black. Also, by placing a new white stone to the left end of the row of stones, all black stones will become white.  In either way, Jiro's purpose can be achieved by placing one stone.       Sample Input 2 WWWWWW      Sample Output 2 0  If all stones are already of the same color, no new stone is necessary.       Sample Input 3 WBWBWBWBWB      Sample Output 3 9

Solution (Python):
s = input()
ans = 0
for i in range(len(s)-1):
  if s[i] != s[i+1]:
    ans += 1
print(ans)

Solution (Python):
A=input()
now=A[0]
ans=0
for i in range(1,len(A)):
    if A[i]!=now:
        ans+=1
        now=A[i]
print(ans)

Solution (Python):
s = input()

ans, stone = 0, s[0]
for i in s:
    if stone != i:
        ans += 1
        stone = i
print(ans)

Solution (Python):
s=(input())
pr=s[0]
ans=0
for el in s[1:]:
    if(pr!=el):
        ans+=1
    pr=el
print(ans)

Solution (Python):
S = list(input())

if S[0] == "B":
    flg = True
else:
    flg = False

ans = 0
for i in range(1, len(S)):
    s = S[i]
    if s == "B":
        tmp = True
    else:
        tmp = False

    if flg != tmp:
        ans += 1
        flg = not flg

print(ans)

Solution (Python):
s = input()
print(sum(x != y for x, y in zip(s, s[1:])))

Solution (Python):
S=input()
ans=0
for i in range(len(S)-1):
    if S[i]!=S[i+1]:
        ans+=1
print(ans)

Solution (Python):


s = str(input())
lst = []
for i in s:
    if not lst:
        lst.append(i)
    if i != lst[-1]:
        lst.append(i)
        
print(len(lst)-1)

Solution (Python):


import sys
read = sys.stdin.read
readline = sys.stdin.readline



s = input()

ans = 0
for i,j in zip(s,s[1:]):
    if i!=j: ans+=1

print(ans)

Solution (Python):
s = input()
n = len(s)
cnt = 0
for i in range(n-1):
    if s[i] != s[i+1]:
        cnt += 1
print(cnt)

Solution (Python):
s = input()
ans = 0
for i in range(len(s)-1):
    if s[i+1] != s[i]:
        ans += 1
print(ans)

Solution (Python):
s=input()
str=s[0]
ans=0
for i in range(1,len(s)):
    if str!=s[i]:
        ans+=1
        str=s[i]
print(ans)

Solution (Python):
S = input()

ans = 0
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans += 1

print(ans)

Solution (Python):
a = input()
count = 0
for i in range(1,len(a)):
    if a[i] != a[i-1]:
        count += 1
print(count)

Solution (Python):
from itertools import groupby

s = input()
print(len(list(groupby(s))) - 1)

Solution (Python):
S=input()
tmp=""
N=len(S)
count=0
for i in range(N):
	if i==0:
		tmp=S[i]
		count=1
	else:
		if S[i]!=tmp:
			tmp=S[i]
			count+=1
print(count-1)

Solution (Python):
S = list(str(input()))
l = []
ls = len(S)
B,W = 0,0
for i in range(ls):
  if S[i] == "B":
    B += 1
    if W != 0:
      l.append('W')
      W = 0
  else:
    W += 1
    if B != 0:
      l.append('B')
      B = 0
  if i == ls-1:
    if S[i] == "B":
      l.append("B")
    elif S[i] == "W":
      l.append("W")
ls = len(l)

print(ls-1)

Solution (Python):
A= list(input())
ans = 0
for i in range(len(A)-1):
    if A[i] != A[i+1]:
        ans += 1
print(ans)

Solution (Python):

s = list(input())
count = 0

for i in range(len(s)-1):
    if s[i] != s[i+1]:
        count += 1

print(count)

Solution (Python):
S = input()

cnt = 0
for i in range(len(S)-1):
    if(S[i] != S[i+1]):
        cnt += 1
print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





s=list(ss())
cnt=0
chk=True
if s[0]=="B":
    chk=False
for i in range(len(s)-1):
    if chk==True and s[i+1]=="B":
        chk=False
        cnt+=1
    elif chk==False and s[i+1]=="W":
        chk=True
        cnt+=1
print(cnt)

Solution (Python):
s = input()
ans = 0
for i in range(len(s)-1):
    if s[i]!= s[i+1]:
        ans += 1
print(ans)

Solution (Python):
S = input()
l = [S[0]]

for i in range(1,len(S)):
    if (S[i] != l[len(l)-1]):
        l.append(S[i])

print(len(l)-1)

Solution (Python):
def solve():
    S = input()
    
    ans = 0
    p_char = S[0]
    for char in S[1:]:
        if p_char != char:
            ans += 1
            p_char = char
    print(ans)


if __name__ == '__main__':
    solve()

Solution (Python):
S = str(input())

counting = 0

for i in range(len(S)-1):
    if S[i] != S[i+1]:
        counting+=1
print(counting)

Solution (Python):

S = input()
old = 'init'
ans = -1
for s in S:
    if old!=s:
        ans += 1
    old = s
print (ans)

Solution (Python):

import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache
import heapq

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3,d + 1,2):
            if n % i == 0:
                return False
        return True


MOD = int(1e09) + 7

def main():
    S = cin.string()
    N = len(S)
    ans = 0
    for i in range(N - 1):
        if S[i] != S[i + 1]:
            ans +=1
    print(ans)
    return

if __name__ == "__main__":
    main()

Solution (Python):
S = input()

con = 0

latest = S[0]

for i in S:
  if i != latest:
    con += 1
    latest = i
    
print(con)

Solution (Python):
s=input()
cnt=0
for i in range(1,len(s)):
  if s[i]!=s[i-1]:
    cnt+=1
print(cnt)

Solution (Python):
from collections import Counter

S = input()
c = Counter(S)

if len(c) == 1:
    print(0)
    exit(0)

cbi = Counter([S[i:i+2] for i in range(len(S) - 1)])
counter = 0
if 'BW' in cbi:
    counter += cbi['BW']
if 'WB' in cbi:
    counter += cbi['WB']
print(counter)

Solution (Python):
import sys
readline = sys.stdin.readline
S = readline().strip()

pre = None
ans = -1
for s in S:
    if s != pre:
        ans += 1
    pre = s
print(ans)

Solution (Python):
s=input()
ans=0
for i in range(1,len(s)):
  if s[i]!=s[i-1]:
    ans+=1
print(ans)

Solution (Python):
s = input()
c = 0
for i in range(len(s)-1):
  if s[i] != s[i+1]:
    c += 1
    
print(c)

Solution (Python):
S=input()
cnt=1;col=S[0]
for c in S[1:]:
    if c!=col:
        col=c
        cnt+=1
print(cnt-1)

Solution (Python):
S = input()
ans = 0
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans += 1
print(ans)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    cnt = 0
    for i in range(1, len(s)):
        if s[i] != s[i-1]:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()

Solution (Python):
S = input()
c = 0

for i in range(len(S)-1) :
    if S[i] != S[i+1] :
        c += 1
print(c)

Solution (Python):
S = input()
print(sum(int(a!=b) for a,b, in zip(S,S[1:])))

Solution (Python):
S = input()
ans = 0
for k in range(1,len(S)):
    if S[k-1] != S[k]:
        ans += 1
print(ans)

Solution (Python):
s=input();print(s.count("BW")+s.count("WB"))

Solution (Python):
s=input();print(s.count("BW")+s.count("WB"))

Solution (Python):
S = str(input())
ans = 0
for i in range(1, len(S)):
    if S[i-1] != S[i]:
        ans += 1
print(ans)

Solution (Python):
uniq = []

for c in input():
    if not uniq:
        uniq += c
    elif uniq[-1] != c:
        uniq += c

print(len(uniq)-1)

Solution (Python):
S = input()
N = len(S)

s = 0

for i in range(N-1):
  if S[i] != S[i+1]:
    s += 1
print(s)

Solution (Python):
cnt = 0
s = list(input())
for i, v in enumerate(s):
    if i > 0:
        if s[i] != s[i-1]:
            cnt += 1
print(cnt)

Solution (Python):
s = input()
ans = 0
for i in range(len(s) - 1):
    if s[i] != s[i + 1]:
        ans += 1
print(ans)

Solution (Python):
S = input()
count = 0
for i in range(1, len(S)):
    if S[i - 1] != S[i]:
        count += 1

print(count)

Solution (Python):
s = input()
ans = 0
for i in range(len(s) - 1):
    if s[i] != s[i + 1]:
        ans += 1
print(ans)

Solution (Python):
S = input()
ans = 0
for i in range(len(S) - 1):
    if S[i] != S[i + 1]:
        ans += 1
        
print(ans)

Solution (Python):
a = input()
b = 0
for i in range(1, len(a)):
    if a[i] != a[i-1]:
        b += 1
print(b)

Solution (Python):
S = input()
f = S[0]
ct = 0
for s in S:
  if s != f:
    ct += 1
    f = s
print(ct)

Solution (Python):
s=input()
l=list(s)
base=l[0]
counter=0
for i in l:
    if base != i:
        counter+=1
        base=i
print(counter)

Solution (Python):


import sys


hoge=input()





n=len(hoge)

ans=0
for i in range(0,n-1):
	if(hoge[i]!=hoge[i+1]):
		ans+=1
print(ans)

Solution (Python):
a = input()
b = 0
for i in range(1, len(a)):
    if a[i] != a[i-1]:
        b += 1
print(b)

Solution (Python):
S=input()
mode=S[0]
cnt=0
for i in range(len(S)):
    if S[i]!=mode:
        cnt+=1
        if mode=='B':
            mode='W'
        else:
            mode='B'
print(cnt)

Solution (Python):
S = input()

ans = 0
pre = ""
for s in S:
    if pre == "":
        pre = s
    elif pre != s:
        ans += 1
    pre = s

print(ans)

Solution (Python):
s = list(input())
c = 0
for i in range(len(s) - 1):
	if s[i] != s[i+1]:
		c += 1
print(c)

Solution (Python):



S = list(input())
S_len = len(S)
tmp = 0

for i in range(S_len - 1):
    if S[i] != S[i + 1]:
        tmp += 1
print(tmp)

Solution (Python):
s=input()
print(sum([s[i+1]!=s[i] for i in range(len(s)-1)]))

Solution (Python):
s = input()
c = 0
for i in range(1,len(s)):
    if s[i-1] != s[i]:
        c += 1
print(c)

Solution (Python):
s=input()
cnt=0
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        cnt+=1
print(cnt)

Solution (Python):
S = input()
now = S[0]
ans = 0
for c in S[1:]:
    if c != now:
        now = c
        ans += 1
print(ans)

Solution (Python):
s = input()
ans = 0
for i in range(len(s)-1):
  if s[i+1] != s[i]:
    ans += 1
print(ans)

Solution (Python):

def main():
    S = input()
    print(S.count("BW") + S.count("WB"))


if __name__ == "__main__":
    main()

Solution (Python):
S = input()
ans = 0
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans += 1
print(ans)

Solution (Python):

S = input()
print(S.count("BW") + S.count("WB"))

Solution (Python):
s = input()

ans = 0
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        ans += 1

print(ans)

Solution (Python):
S = list(input())
N = len(S)
print(sum([S[x]!=S[x+1] for x in range(N-1)]))

Solution (Python):
stones = input()
count = 0
for i in range(0, len(stones)-1):
    if stones[i] != stones[i+1]:
        count += 1
print(count)

Solution (Python):
S = input()
if len(S) == 1:
    print(0)
else:
    ans = 0
    for x, y in zip(S, S[1:]):
        if x != y:
            ans += 1
    print(ans)

Solution (Python):
S = input()
count = 0
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        count += 1
print(count)

Solution (Python):
s = input()
cnt = 0
color = s[0]
for i in range(1,len(s)):
    if s[i] != color:
        cnt += 1
        color = s[i]
print(cnt)

Solution (Python):
s = input()
now = s[0]
ans = 0
for i in s[1:]:
  if now != i:
    ans += 1
  now = i
print(ans)

Solution (Python):
s = input()
pre = 0
ans = -1
for i in s:
    if i != pre:
        ans += 1
    pre = i
print(ans)

Solution (Python):
S = input()

h = 0
for i in range(len(S)-1):
  if (  S[i] != S[i+1] ):
    h += 1
print (h)

Solution (Python):
S = input()

ans = 0

for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans += 1

print(ans)

Solution (Python):
S = [i for i in input()]
ans = 0
for i in range(len(S)-1):
    if S[i]=="W" and S[i+1]=="B":
        ans+=1
    elif S[i]=="B" and S[i+1]=="W":
        ans+=1
print(ans)

Solution (Python):
S=input()
block=0
for i in range(len(S)):
  if i==0:
    block+=1
  elif S[i]!=S[i-1]:
    block+=1
print(block-1)

Solution (Python):
S = input()

count = 0
prev = S[0]
for s in S[1:]:
    if s != prev:
        count += 1
        prev = s
print(count)

Solution (Python):
s=input()
w=b=False
cnt=0
for i in s:
  if i=="B":
    if w==True:
      cnt+=1
      w=False
      b=True
    else:
      b=True
  else:
    if b==True:
      cnt+=1
      b=False
      w=True
    else:
      w=True
print(cnt)

Solution (Python):
S = input()
print(sum([a!=b for a,b in zip(S[:-1],S[1:])]))

Solution (Python):
s = input()
n = len(s)
ans = 0
now = s[0]
for i in range(1, n):
    if s[i] != now:
        ans += 1
        now = s[i]

print(ans)

Solution (Python):
s = input()
print(s.count('WB') + s.count('BW'))

Solution (Python):
s=input()
c=1
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        c+=1
print(c-1)

Solution (Python):
S = input()
Slen = len(S)
cnt = 0
index = 0
if S[0] == "B":
    while index <= Slen-2:
        if S[index] == "B" and S[index+1] == "W":
            cnt += 1
            index += 2
        else:
            index += 1
    if S[-1] == "W":
        print(str(cnt*2-1))
    else:
        print(str(cnt*2))
else:
    while index <= Slen-2:
        if S[index] == "W" and S[index+1] == "B":
            cnt += 1
            index += 2
        else:
            index += 1
    if S[-1] == "B":
        print(str(cnt*2-1))
    else:
        print(str(cnt*2))

Solution (Python):
s=input()
print(s.count("BW")+s.count("WB"))

Solution (Python):
s = input()
print([ c != d for c, d in zip(s[:-1], s[1:])].count(True))

Solution (Python):
S = input()

ans = 0
for a, b in zip(S, S[1:]):
    if a != b:
        ans += 1

print(ans)

Solution (Python):
S = input()

ans = 0
now = S[0]
for s in S[1:]:
    if s != now:
        now = s
        ans += 1
print(ans)

Solution (Python):
ls=input().strip()
a=ls[0]
b=0
for i in ls[1:]:
     if i!=a:
          b+=1
          a=i
print(b)

Solution (Python):
ls=input().strip()
a=ls[0]
b=0
def fun():
     print('a')
     print('b')
for i in ls[1:]:
     if i!=a:
          b+=1
          a=i
print(b)

Solution (Python):
s_long = input()

count = 0
prev = ''

for s in s_long:
    if prev == '':
        prev = s
        continue

    if prev != s:
        count += 1
        prev = s

print(count)

Solution (Python):

S = input()
count = 0
stn = S[0]
i = 1
while i<len(S):
    while i<len(S) and stn==S[i] : i+=1 
    if i<len(S): 
        count += 1
        stn = S[i]
print(count)

Solution (Python):
s=input()
c=0
t=s[0]
for i in range(1,len(s)):
    if t!=s[i]:
        c+=1
        t=s[i]
print(c)

Solution (Python):
S = input()
cc = 0
for i in range(len(S)-1):
  if S[i] != S[i + 1]:
    cc += 1
print(cc)

Solution (Python):
s=input()

ans=0
pre=s[0]
for i in range(1,len(s)):
    if(pre==s[i]):
        continue
    else:
        ans+=1
        pre=s[i]

print(ans)

Solution (Python):
s = input()

stones = [1 if v == 'W' else 0 for v in s]

cnt = 0
for a, b in zip(stones, stones[1:]):
    if a ^ b:
        cnt += 1
print(cnt)

Solution (Python):
s = input()
a = s.count("B")
b = s.count("W")
n = len(s)
if a == len(s) or b == len(s):
    print(0)
    exit()
ans = 0
ans2 = 0
for i in range(1,n):
    if s[i] != s[i-1]:
        ans+=1
for i in range(n-2,-1,-1):
    if s[i] != s[i+1]:
        ans2+=1
print(min(ans,ans2))

Solution (Python):

from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007


"""
a,b = LS()
c = int(a+b)
for i in range(1,1000):
    if i * i == c:
        print("Yes")
        quit()
print("No")
"""


"""
a,b = LI()
if a*b <= 0:
    print("Zero")
else:
    if b < 0:
        if (a-b) %2 == 1:
            print("Positive")
        else:
            print("Negative")
    else:
        print("Positive")
"""


"""
n = II()
s = SR(n)
march = [[] for i in range(5)]
ch = list("MARCH")
for i in s:
    for j in range(5):
        if i[0] == ch[j]:
            march[j].append(i)
ans = 0
for i in range(5):
    for j in range(i):
        for k in range(j):
            if len(march[i])*len(march[j])*len(march[k]) == 0:
                break
            ans += len(march[i])*len(march[j])*len(march[k])
print(ans)
"""


"""
n = II()
d = LIR(n)
q = II()
p = IIR(q)
d.insert(0,[0 for i in range(n+1)])
for i in range(n):
    d[i+1].insert(0,0)
for i in range(n):
    for j in range(n):
        d[i+1][j+1] += d[i+1][j]+d[i][j+1]-d[i][j]
ans = [0 for i in range(n**2+1)]

for a in range(n+1):
    for b in range(n+1):
        for c in range(a):
            for e in range(b):
                ans[(a-c)*(b-e)] = max(ans[(a-c)*(b-e)],d[a][b]-d[c][b]-d[a][e]+d[c][e])

for i in p:
    an = 0
    for a in range(i+1):
        an = max(an, ans[a])
    print(an)
"""


s = list(S())
ans = -1
s.insert(0,0)
d = 0
for i in range(1,len(s)):
    if s[i] != d:
        d = s[i]
        ans += 1
print(ans)

Solution (Python):

"""
import math
a, b = map(str, input().split())
j = int(a + b)
if math.sqrt(j).is_integer():
    print("Yes")
else:
    print("No")
"""


"""
ans = ["Positive","Negative"]
a, b = map(int, input().split())
if 0 < a:
    print("Positive")
elif b >= 0:
    print("Zero")
else:
    print(ans[(b-a)%2-1])
"""


"""
import itertools
n = int(input())
MARCH = ["M", "A", "R", "C", "H"]
march = [0 for _ in range(5)]
for i in range(n):
    s = input()
    if s[0] in MARCH:
        march[MARCH.index(s[0])] += 1
num = list(range(5))
a = list(itertools.combinations(num, 3))
ans = 0
for i in a:
    bf = 1
    for k in i:
        bf *= march[k]
    ans += bf
print(ans)
"""


"""
n = int(input())
D = [list(map(int, input().split())) for _ in range(n)]
q = int(input())
p = [int(input()) for _ in range(q)]
for i in range(n):
    D[i].insert(0, 0)
    D[i].insert(n+1, 0)
D.insert(0,[0 for _ in range(n + 2)])
D.insert(n + 2, [0 for _ in range(n + 2)])
print(D)
"""


s = input()
bf = s[0]
ans = 0
for i in range(1,len(s)):
    if bf != s[i]:
        ans += 1
        bf = s[i]
print(ans)

Solution (Python):
s = str(input())
n = len(s)
count = 0
now = s[0]
for i in range(n):
    if not s[i]==now:
        count += 1
        now = s[i]
print(count)

Solution (Python):
s = input()

ans = 0

for x, y in zip(s, s[1:]):
  if x != y:
    ans += 1

print(ans)

Solution (Python):
S = input()

before = S[0]
ans = 0

for i in range(1, len(S)):
    if before != S[i]:
        before = S[i]
        ans += 1

print(ans)

Solution (Python):
a=list(input())

n = len(a)

res = 0
for i in range(1,n):
    if a[i]!=a[i-1]:
        res += 1

print(res)

Solution (Python):
ar = list(input())
n = ""
count = 0
for r in ar:
    if n != r:
        count += 1
        n = r
print(count-1)

Solution (Python):
s = input()
now = s[0]
ans = 0
for i in s:
    if now != i:
        now = i
        ans += 1
print(ans)

Solution (Python):
S=input()
a=0
for i in range(len(S)-1):
    if S[i]!=S[i+1]:
        a+=1
print(a)

Solution (Python):
s = input()

before = None
ans = 0
for c in s:
    if c != before:
        ans += 1
        before = c
print(ans -1)

Solution (Python):
S=input().strip()
N=len(S)
snum=1
ns=S[0]
def solve(S):
    global ns,snum
    for i in range(N):
        
        if ns!=S[i]:
            snum+=1
            ns=S[i]
    
    
    
    return snum

print(solve(S)-1)

Solution (Python):

import sys
import collections
import itertools
import math
import re
from collections import Counter
from collections import deque

MOD = 10 ** 9 + 7

S = input()

l = [S[0]]

for s in S:
    if l[-1] != s:
        l.append(s)

print(len(l) - 1)

sys.exit(0)

Solution (Python):
s=input()
def f(s):
    a=s[0]
    N=len(s)
    ans=0
    for i in range(1,N):
        if a!=s[i]:
            ans+=1
            a=s[i]
    return ans
print(min(f(s),f(s[::-1])))

Solution (Python):
S = input()
ret = 0
for i in range(len(S) - 1):
    if S[i] != S[i + 1]:
        ret += 1
print(ret)

Solution (Python):
S = list(input())

c = 0

x = S[0]
for i in range(len(S) - 1):
	if x != S[i + 1]:
		c += 1
	x = S[i + 1]

print(c)

Solution (Python):
Ss = input()

ans = 0
prevS = Ss[0]
for S in Ss[1:]:
    if S != prevS:
        ans += 1
        prevS = S

print(ans)

Solution (Python):
S=input();
DifF=0;
First=S[0];
len=len(S)
End=S[len-1];
for i in range(len-1):
    if S[i]!=S[i+1]:
        DifF+=1;
print(DifF);

Solution (Python):
s = input()
ans = 0
for i in range(len(s) - 1):
    if s[i] != s[i + 1]:
        ans += 1
print(ans)

Solution (Python):
s = input()
ans = 0
for t,u in zip(s[:-1],s[1:]):
    if t != u:
        ans += 1

print(ans)

Solution (Python):
s = str(input())
cou = 0
for i in range(len(s)-1):
  if s[i+1] != s[i]:
    cou += 1
print(cou)

Solution (Python):
S = input()

kugiri = 0
compare = S[0]

for i in range(1,len(S)):
    if compare == S[i]:
        continue
    else:
        compare = S[i]
        kugiri += 1

print(kugiri)

Solution (Python):
s = list(input())
a = 0
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        a += 1
print(a)

Solution (Python):
S = input()
ans = 0

lastColor = S[0]
for i in range(1, len(S)):
    if S[i] != lastColor:
        lastColor = S[i]
        ans += 1

print(ans)

Solution (Python):
s = input()
c1, c2 = s[0], s[-1]
cnt1, cnt2 = 0, 0
for i in range(1, len(s)):
  if c1!=s[i]:
    cnt1 += 1
    c1 = s[i]
for i in range(len(s)-2, -1, -1):
  if c2!=s[i]:
    cnt2 += 1
    c2 = s[i]
print(min(cnt1, cnt2))

Solution (Python):
ret = 0
s = raw_input()
for i in xrange(len(s)-1):
	if s[i] != s[i+1]:
		ret += 1
print ret

Solution (Python):
s=input()
cnt=0
for i in range(1,len(s)):
  if s[i-1]!=s[i]:
    cnt+=1
print(cnt)

Solution (Python):
n = input()
count = 0
now = n[0]
for i in n:
    if i != now:
        count += 1
        now = i
print(count)

Solution (Python):
s = input()
r = 0
for i in range(len(s)):
    if i == 0: continue
    else:
        if s[i] != s[i-1]:
            r += 1
print(r)

Solution (Python):
s = list(input())
ans = 0
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		ans += 1

print(ans)

Solution (Python):
S = input()

back = S[0]
ans = 0
for s in S[1:]:
    if back != s:
        ans += 1
    back = s
    
print(ans)

Solution (Python):
S = input()
henka = 0
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        henka += 1
print(henka)

Solution (Python):
s=input();print(s.count('BW')+s.count('WB'))

Solution (Python):
s=input()
ans = 0
for i in range(len(s)-1):
 if s[i]!=s[i+1]:
  ans += 1
print(ans)

Solution (Python):

S = input()
print(S.count("BW") + S.count("WB"))

Solution (Python):
s=input()
total=0
for i in range(len(s)-1):
    if s[i+1]!=s[i]: total+=1
print(total)

Solution (Python):
s=list(input())
count=0
for i in range(len(s)-1):
    if s[i]=="W":
        if s[i+1]!="W":
            count+=1
    if s[i]=="B":
        if s[i+1]!="B":
            count+=1
print(count)

Solution (Python):
print((lambda s:s.count('WB')+s.count('BW'))(input()))

Solution (Python):
s=input()
print(s.count('WB')+s.count('BW'))

Solution (Python):
s=input()
c=s[0]
ans=0
for cn in s:
    if cn!=c:
        c=cn
        ans+=1
print(ans)

Solution (Python):
s = raw_input()
cnt = 0
for i in range(len(s) - 1):
  if s[i] != s[i + 1]:
    cnt += 1

print cnt

Solution (Python):
S=input()
n=len(S)
ans=0
for i in range(n-1):
  if S[i]!=S[i+1]: ans+=1
print(ans)

Solution (Python):



import itertools

def main():
    S = input()

    groups = itertools.groupby(S)
    ans = sum(1 for _ in groups) - 1
    print(ans)

if __name__ == "__main__": main()

Solution (Python):
s = input()
ret = 0
for i in range(len(s)-1):
    ret += s[i] != s[i+1]
print(ret)

Solution (Python):

import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
r = range

s = input()
ret = 0
for i in range(len(s)-1):
    ret += s[i] != s[i+1]
print(ret)

Solution (Python):
s=raw_input()
ans=0
for i in xrange(len(s)-1):
    if s[i]!=s[i+1]:
        ans+=1
print ans

Solution (Python):
s=raw_input()
now=s[0]
ans=0
for i in xrange(1,len(s)):
    if now!=s[i]:
        ans+=1
        now=s[i]
print ans

Solution (Python):
s=raw_input()
now=s[0]
ans=0
for i in xrange(1,len(s)):
    if now!=s[i]:
        ans+=1
        now=s[i]
print ans

Solution (Python):
S = raw_input()
T = S[0]
for s in S[1:]:
    if T[-1] == s: continue
    T += s
print len(T) - 1

Solution (Python):
S = raw_input().strip()

count = -1
lastChar = ""
for char in S:
    if(char != lastChar):
        count += 1
        lastChar = char

print count

Solution (Python):
s=input()
print(s.count("WB")+s.count("BW"))

Solution (Python):

list = list(input())
result = 0
 
for i in range(len(list)-1):
    if list[i]!=list[i+1]:
        result+=1
 
print(result)

Solution (Python):
s = input()

a = 0
for i in range(1, len(s)):
    if s[i - 1] != s[i]:
        a += 1

print(a)

Solution (Python):

import sys

s = sys.stdin.readline()
w = len([i for i in s.split('B') if i != '' and i != '\n'])
b = len([i for i in s.split('W') if i != '' and i != '\n'])
print(w + b - 1)

Solution (Python):



s = raw_input()
cnt = 0
last_word = s[0]
for i in range(len(s)):
  if s[i] != last_word:
    cnt += 1
    last_word = s[i]

print cnt

Solution (Python):
s = raw_input()

ans = 0
c = s[0]

for i in range(1,len(s)):
    if c!=s[i]:
        ans += 1
        c = s[i]

print(ans)

Solution (Python):
s = list(input())

cnt = 0
for i in range(len(s) - 1):
    if s[i] != s[i + 1]:
        cnt += 1

print(cnt)

Solution (Python):
s = input()
prev = s[0]
ans = 0

for c in s:
    if c != prev:
        ans += 1
        prev = c
print(ans)

Solution (Python):
input_lines = input()
S = list(input_lines)

def my_func(S):
    current = S[0]
    nodes = 0
    for item in S[1:]:
        if current != item:
            current = item
            nodes += 1
    print(nodes)

my_func(S)

Solution (Python):

s = raw_input()
cnt = 0
last = s[0]
 
for c in s[1:]:
    if c != last:
        cnt = cnt+1
    last = c
print cnt

Solution (Python):


s = input()
a=0;b=0;
a=s.count("WB")
b=s.count("BW")

print(a+b)

Solution (Python):
inp = raw_input().strip()
print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )

Solution (Python):
from itertools import groupby
print(sum(1 for _ in groupby(input())) - 1)

Solution (Python):
from itertools import groupby
print(sum(1 for _ in groupby(input())) - 1)

Solution (Python):
from itertools import groupby
print(sum(1 for _ in groupby(input())) - 1)

Solution (Python):
a=raw_input()
ary=list(a)
count = 0

tmp=ary[0]
for i,v in enumerate(ary):
  if v == tmp:
    tmp=v
  else:
    tmp=v
    count += 1

print count

Solution (Python):
S=input()

prev = S[0]
res=0
for i in range(1,len(S)):
	if S[i]!=prev:
		res+=1
		prev=S[i]

print(res)

Solution (Python):
S = list(raw_input())

if len(set(S)) == 1:
    print 0
else:
    while S[-1] == S[-2]:
        del S[-1]
    del S[-1]

    count = 1
    for i in xrange(len(S)-1):
        if S[i] != S[i+1]:
            count += 1
    print count

Solution (Python):
s = [x for x in raw_input()]

step = len(s)

idx = 0
p = s[-1]
for i in range(step -1, -1, -1):
    if s[i] != p:
        s.append(s[i])
        p = s[i]
        idx += 1

print idx

Solution (Python):
S=raw_input()

ans = 0
for i in range(len(S)-1):
    if S[i]!=S[i+1]:
       ans+=1
print ans

Solution (Python):
S = input()
state = 'A'
count = -1
for c in S:
    if c!=state:
        count+=1
        state=c
print(count)

Solution (Python):
s = input()
c = 0
n = ""
for i in s:
    if not n == i:
        c+=1
        n = i
print(c-1)

Solution (Python):

s = input()
print(s.count('BW') + s.count('WB'))

Solution (Python):


bw = input()
cnt = 0
t = bw[0]
for i in bw[1:]:
    if i != t:
        cnt += 1
        t = i
print(cnt)

Solution (Python):
def main():
    s = raw_input()
    check_b = lambda x: x=='B'
    check_w = lambda x: x=='W'
    if all(map(check_b, list(s))) or all(map(check_w, list(s))):
        return 0

    work = list(s)[:]
    cnt = 0
    for i in range(len(work)-1):
        w_list = work[i:i+2]
        if w_list[0] == w_list[1]:
            pass
        else:
            cnt += 1

    return cnt



if __name__ == '__main__':
    print main()

Solution (Python):

def main():
    s = raw_input()
    check_b = lambda x: x=='B'
    check_w = lambda x: x=='W'
    if all(map(check_b, list(s))) or all(map(check_w, list(s))):
        return 0

    work = list(s)[:]
    flag_b = False
    flag_w = False
    stack = []
    cnt = 0
    for i in range(len(work)-1):
        w_list = work[i:i+2]
        if w_list[0] == w_list[1]:
            pass
        else:
            cnt += 1

    return cnt



if __name__ == '__main__':
    print main()