#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b);
long long int lcm(long long int x, long long int y);
long long int bur(long long int N, long long int X);
std::vector<long long int> enum_div(long long int n);
long long comb(int n, int r);
bool IsPrime(int num);
bool dp[110][10010];
class UnionFind;
class UnionFind {
 public:
  vector<int> Parent;
  UnionFind(int N) { Parent = vector<int>(N, -1); }
  int root(int A) {
    if (Parent[A] < 0) return A;
    return Parent[A] = root(Parent[A]);
  }
  int size(int A) { return -Parent[root(A)]; }
  int connect(int A, int B) {
    A = root(A);
    B = root(B);
    if (A == B) {
      return false;
    }
    if (size(A) < size(B)) swap(A, B);
    Parent[A] += Parent[B];
    Parent[B] = A;
    return true;
  }
};
int main(void) {
  long long int N = 0;
  long long int A = 0;
  long long int B = 0;
  long long int C = 0;
  long long int D = 0;
  long long int E = 0;
  long long int W = 0;
  long long int K = 0;
  long long int b[9] = {1, 7, 4, 5, 3, 2, 9, 6, 8};
  long long int d[10] = {};
  string S, T, U[52];
  char fi[50], fv[50];
  char board[4][4];
  long long int count = 0;
  double count2 = 0;
  long long int min = 3000;
  long long int max = 1;
  long long int dist1 = 0;
  long long int dist2 = 0;
  long long int dist3 = 0;
  long long int now = 0;
  int tmax = 10000;
  int tmax2 = 0;
  bool start = false;
  long long int all = 0, all2 = 0, all3 = 0;
  long long int amr = 0;
  long long int first = 0;
  long long int second = 0;
  long long int keep = 0;
  char col = NULL;
  cin >> S;
  for (long long int i = (0); i < (S.length() - 1); ++i) {
    if (i == S.length() - 2) {
      if (S[i] == S[i + 1]) {
        count++;
        break;
      } else {
        count += 2;
        break;
      }
    }
    if (S[i] != S[i + 1]) {
      count++;
    } else {
      count += 2;
      i += 2;
    }
  }
  cout << count << endl;
  return 0;
}
std::vector<long long int> enum_div(long long int n) {
  std::vector<long long int> ret;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i != 1 && i * i != n) {
        ret.push_back(n / i);
      }
    }
  }
  return ret;
}
long long int bur(long long int N, long long int X) {
  long long int pan = 1;
  long long int pat = 1;
  long long int burg = 0;
  if (X > burg) {
    if (N == 0) return pat;
    burg += pan;
    burg += bur(N - 1, X);
    burg += pat;
    burg += bur(N - 1, X);
    burg += pan;
  }
  return burg;
}
long long int gcd(long long int a, long long int b) {
  if (a < b) {
    long long int tmp = a;
    a = b;
    b = tmp;
  }
  long long int x = b;
  long long int y = a;
  long long int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return y / b * x;
}
bool IsPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
long long int lcm(long long int x, long long int y) {
  if (x == 0 || y == 0) {
    return 0;
  }
  return (x * y / gcd(x, y));
}
long long comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,
                                        std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v[n][r];
}
