using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;


class Program {

	static long mod = 1000000007;
	static int[] ans;
	static void Main(string[] args) {

		char[] cs = new char[] { ' ' };
		//char[] cs = new char[] { ' ', ',' };

		//int n = int.Parse(Console.ReadLine());
		//int val = int.Parse(Console.ReadLine());
		//int[] vals = parseAry(Console.ReadLine().Split(cs));
		//string str = Console.ReadLine();
		//string[] strs = Console.ReadLine().Split(cs);

		//string res = "";
		int res=0;
		string now = "";

		string str = Console.ReadLine();
		int sw = 0;

		for ( int i = 0; i < str.Length; i++ ) {
			for ( int k = 1; k <= str.Length - i; k++ ) {
				sw = k;
				string sub = str.Substring(i, k);				
				if ( now!=sub ) { now=sub; res++; break; }
			}
			i = i + sw-1;
		}



			Console.WriteLine(res);

			return;

	}



	//	int配列をスペース区切りの文字列に変換
	static string stringBuilderArrayInt(int[] a) {
		StringBuilder sb = new StringBuilder();

		for ( int i = 0; i < a.Length; i++ ) {
			if ( a[i] == 1 ) { sb.Append(i + " "); }
		}
		if ( sb.Length > 1 ) {
			sb = sb.Remove(sb.Length - 1, 1);
		}
		return sb.ToString(); ;
	}


	//	文字列strをindex番目からdで上書き
	static string strOverWrite(string str, int i, string s) {
		return str.Remove(i, s.Length).Insert(i, s);
	}

	//　String[]  ----->  int[]
	static int[] parseAry(string[] str) {
		int[] nums = new int[str.Length];
		for ( int i = 0; i < str.Length; i++ ) { nums[i] = int.Parse(str[i]); }
		return nums;
	}
	//　String[]  ----->  long[]
	static long[] parseAryL(string[] str) {
		long[] nums = new long[str.Length];
		for ( int i = 0; i < str.Length; i++ ) { nums[i] = long.Parse(str[i]); }
		return nums;
	}

	//文字列を1文字ずつString[]に入れる
	static string[] strAry(String str) {
		string[] re = new string[str.Length];
		for ( int i = 0; i < str.Length; i++ ) { re[i] = str[i].ToString(); }
		return re;
	}



	public class PriQ {
		public int rank { get; set; }
		public string rankstr { get; set; }
		public int num { get; set; }
		public int[] nums { get; set; }
		public Object obj { get; set; }
		public PriQ() { }
	}

	public class PriorityQueue {
		List<PriQ> list = new List<PriQ>();
		public PriorityQueue() { }
		public PriorityQueue(PriQ p) { list.Add(p); }
		public void Enqueue(PriQ item) { list.Insert(Binary_Search(item), item); }
		public void EnqueueStr(PriQ item) { list.Insert(Binary_Search_Str(item), item); }
		public PriQ Dequeue() { PriQ r = list[0]; list.RemoveAt(0); return r; }
		public PriQ DequeueLast() { PriQ r = list[list.Count - 1]; list.RemoveAt(list.Count - 1); return r; }
		public PriQ Peek() { return list[0]; }
		public PriQ Get(int n) { return list[n]; }
		public PriQ Last() { return list[list.Count - 1]; }
		public void Remove(int n) { list.RemoveAt(n); }
		public void RemoveRangeEnd(int n) {
			if ( n > list.Count ) { return; }
			list.RemoveRange(n, list.Count - n);
		}
		public void RemoveOverRangeFirst(int n) {
			if ( n > list.Count ) { return; }
			list.RemoveRange(0, list.Count-n);
		}
		public void Clear() { list.Clear(); }
		public int Count { get { return list.Count; } }

		private int Binary_Search(PriQ pq) {
			int Lower = 0;
			int Upper = list.Count - 1;
			while ( Lower <= Upper ) {
				int Center = ( Lower + Upper ) >> 1;
				if ( pq.rank > list[Center].rank ) {
					Lower = Center + 1;
				} else if ( pq.rank < list[Center].rank ) {
					Upper = Center - 1;
				} else {
					return Center;
				}
			}
			return Lower;
		}
		private int Binary_Search_Str(PriQ pq) {
			int Lower = 0;
			int Upper = list.Count - 1;
			while ( Lower <= Upper ) {
				int Center = ( Lower + Upper ) >> 1;
				if ( string.CompareOrdinal(pq.rankstr, list[Center].rankstr) > 0 ) {
					Lower = Center + 1;
				} else if ( string.CompareOrdinal(pq.rankstr, list[Center].rankstr) < 0 ) {
					Upper = Center - 1;
				} else {
					return Center;
				}
			}
			return Lower;
		}
	}
}

Measured memory_bytes: 15712