S=str(input())
l=list(S)
ilength=len(l)
recon=True
while(recon):
  recon=False
  jump=False
  sl=[]
  for i in range(len(l)-1):
    if(int(l[i])+int(l[i+1])==1 and not(jump)):
      recon=True
      jump=True
    else:
      sl.append(l[i])
      jump=False
  l=sl[:]
flength=len(l)
print(ilength-flength)