def main():
    s=input()
    ans=0
    before=""
    keep=False
    for now in s:
      keep= now if before==now else False
      before= keep+now if keep else now
      ans+= keep==False
    print(ans)
if __name__ == "__main__":
    main()