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