# coding: utf-8 s =input() n = len(s) ans = 2 for i in range(n-1): if s[i+1] != s[i]: ans += 1 print(ans)