#include <bits/stdc++.h>

using ll = long long;
#define int long long

namespace ext {
	template <class t>
	struct vec_type;
	template <class t>
	constexpr bool is_vec_v;
	using namespace std;
	template<class t>
	struct vector : std::vector<t> {
		using std::vector<t>::vector;
		char dil = ' ';
		vector<t> accum() {
			vector<t> res(this->size() + 1);
			for (size_t i = 0; i < this->size(); i++) {
				res[i+1] = (*this)[i] + res[i];
			}
			return res;
		}
		template<class u = t>
		typename enable_if<is_vec_v<u>, vector<t>>::type accum2d() {
			const size_t h = this->size();
			const size_t w = (*this)[0].size();
			using s = typename vec_type<u>::type;
			vector<t> res(h + 1, vector<s>(w + 1));
			for (size_t i = 0; i < h; i++) {
				for (size_t j = 0; j < w; j++) {
					res[i+1][j+1] = (*this)[i][j];
					res[i+1][j+1] += res[i][j+1];
					res[i+1][j+1] += res[i+1][j];
					res[i+1][j+1] -= res[i][j];
				}
			}
			return res;
		}
		vector<t> zaatsu() {
			map<t, int> m;
			for (auto& e: *this) m[e] = 1;
			int count = 0;
			for (auto& e: m) e.second = count++;
			vector<t> res = *this;
			for (auto& e: res) e = m[e];
			return res;
		}
		friend istream& operator>>(istream& is, vector<t>& t) {
			for (auto& e: t) cin >> e;
			return is;
		}
		friend ostream& operator<<(ostream& os, vector<t>& t) {
			t.print(' ', os);
			return os;
		}
		void print(char del = ' ', ostream& os = cout) {
			for (size_t i = 0; i < this->size(); i++) {
				os << (*this)[i];
				if (i + 1 != this->size()) os << del;
				os.flush();
			}
		}
		void println(char del = ' ', ostream& os = cout) {
			print(del, os);
			cout << endl;
		}
		long long crossing_merge() {
			auto t = *this;
			return t.crossing_merge_sub();
		}
		// [min_v, max_v)
		long long crossing_bit(t min_v = -1, t max_v = -1) {
			if (min_v == -1) min_v = this->min();
			if (max_v == -1) max_v = this->max() + 1;
			vector<t> bit(max_v - min_v + 1, 0);
			long long res = 0;
			for (auto e: *this) {
				e = max_v - e;
				for (size_t x = e - 1; x; x -= x & -x) {
					res += bit[x];
				}
				for (size_t x = e; x < bit.size() ; x += x & -x) {
					bit[x]++;
				}
			}
			return res;
		}
		bool permutation() {
			return next_permutation(this->begin(), this->end());
		}
		t& max() {
			return *max_element(this->begin(), this->end());
		}
		t& min() {
			return *min_element(this->begin(), this->end());
		}
private:
		long long crossing_merge_sub() {
			if (this->size() == 1) return 0;
			int x = this->size() / 2;
			vector<t> left(this->begin(), this->begin() + x);
			vector<t> right(this->begin() + x, this->end());
			long long res = left.crossing_merge_sub() + right.crossing_merge_sub();
			left.push_back(numeric_limits<t>::max()); right.push_back(numeric_limits<t>::max());
			size_t l = 0, r = 0;
			while (l + r < this->size()) {
				if (left[l] < right[r]) {
					(*this)[l+r] = left[l];
					l++;
				} else {
					(*this)[l+r] = right[r];
					r++;
					res += x - l;
				}
			}
			return res;
		}
	};
	template <class t>
	struct vec_type : std::false_type {};
	template <class t>
	struct vec_type<vector<t>> : std::true_type {
		using type = t;
	};
	template <class t>
	constexpr bool is_vec_v = vec_type<t>::value;
}

// [a -> b-1]
#define reps(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
// [0 -> a-1]
#define rep(i, a) reps(i, 0, (a))
// [a-1 -> b]
#define rreps(i, a, b) for (int i = (int)((a)-1); i >= (int)(b); i--)
// [a-1 -> 0]
#define rrep(i, a) rreps(i, a, 0)
#define all(v) (v).begin(), (v).end()
// next_permutation(all(v))
#define perm(v) next_permutation(all(v))
/*sort(all(v));
 * (v).erase(unique(all(v)), v.end())*/
#define unique(v)\
	sort(all(v));\
	(v).erase(unique(all(v)), v.end())
#define minv(v) min_element(all(v))
#define maxv(v) max_element(all(v))
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min3(a, b, c), d)
#define min5(a, b, c, d, e) min(min4(a, b, c, d), e)
#define min6(a, b, c, d, e, f) min(min5(a, b, c, d, e), f)
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max3(a, b, c), d)
#define max5(a, b, c, d, e) max(max4(a, b, c, d), e)
#define max6(a, b, c, d, e, f) max(max5(a, b, c, d, e), f)
// b is [a, c)
#define range(a, b, c) ((a) <= (b) && (b) < (c))
// c is [a, e) && d is [b, f)
#define range2d(a, b, c, d, e, f) (range((a), (c), (e)) && range((b), (d), (f)))
#define chmin(a, b) a = min(a, (b))
#define chmin3(a, b, c) a = min3(a, (b), (c))
#define chmin4(a, b, c, d) a = min4(a, (b), (c), (d))
#define chmin5(a, b, c, d, e) a = min5(a, (b), (c), (d), (e))
#define chmin6(a, b, c, d, e, f) a = min6(a, (b), (c), (d), (e), (f))
#define chmax(a, b) a = max(a, (b))
#define chmax3(a, b, c) a = max3(a, (b), (c))
#define chmax4(a, b, c, d) a = max4(a, (b), (c), (d))
#define chmax5(a, b, c, d, e) a = max5(a, (b), (c), (d), (e))
#define chmax6(a, b, c, d, e, f) a = max6(a, (b), (c), (d), (e), (f))
#define fcout cout << fixed << setprecision(15)
#define yes(f) cout << ((f) ? yes_str : no_str) << endl;

using namespace std;
using namespace ext;

int dfs(const vector<vector<int>>& g, vector<int>& v, int p) {
	if (p < 0) {
		if (v.size() < 2) return v.size();
		rep(i, v.size()-1) {
			reps(j, i+1, v.size()) {
				if (g[v[i]][v[j]] == 0) return 0;
			}
		}
		return v.size();
	} else {
		int res = dfs(g, v, p-1);
		v.push_back(p);
		chmax(res, dfs(g, v, p-1));
		v.pop_back();
		return res;
	}
}

#define cin input
#define cout output

void solve(istream& input, ostream& output) {
	string s; cin >> s;
	int cnt = 0;
	string pre = "";
	string now = "";
	rep(i, s.size()) {
		now += s[i];
		if (pre != now) {
			cnt++;
			pre = now;
			now = "";
		}
	}
	cout << cnt << endl;
}

#undef cin
#undef cout

#ifndef check_cpp

signed main() {
	solve(cin, cout);
}

#endif
