# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. def journals(s): seeking = True prev = s[0] res = 0 for i in range(1, len(s)): if seeking: if prev == s[i]: seeking = False else: prev = s[i] else: if prev == s[i]: seeking = True res += 1 else: prev = s[i] if not seeking: res += 1 return res # Press the green button in the gutter to run the script. if __name__ == '__main__': print(journals(input())) # See PyCharm help at https://www.jetbrains.com/help/pycharm/