def main():
  s = list(input())
  divide = []
  compare = 0
  for i in range(len(s)):
    if s[i] == compare :
      s[i+1] = s[i] + s[i+1]
    else:
      compare = s[i]
      divide.append(s[i])
  print(len(divide))


if __name__ == '__main__':
  main()
