            #include <iostream>
              constexpr int l = 10000;
            int main()
            {
              char a;
              char buf[l];
              for (int j = 0; j < l; j++) {
                buf[l] = -1;
              }
              int k = 1;
              while (1) {
                std::cin >> buf[0];
                if (std::cin::eof()) {
                  break;
                }
                for (int p = 0; 1; p++) {
                  std::cin >> a;
                  if (buf[p] != a) {
                      buf[p] = a;
                      k++;
                      break;
                  }
                }
              }
              std::cout << k;
              }