s=str(input())
ue=-1
ans=0
for i in range(len(s)):
  if(ue==-1):
    ue=int(s[i])
  elif(int(s[i])==ue):
    ans+=2
    if(ans==i+1):
      ue=-1
    else:
      ue=1-ue
  else:
    ue=1-ue
print(ans)
