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

class Program
{

    static void Main(string[] args)
    {
        char[] c = Console.ReadLine().ToCharArray();
        int N = c.Length;

        List<string> vs = new List<string>();

        Console.Write(""+ GetAns(c, N, vs, 0));
        Console.ReadKey();
    }

    public static int GetAns(char[] c,int N,List<string> list,int i)
    {
        if(i == N)
        {
            return list.Count;
        }
        int max = 0;

        for (int l = 1; l <= (N - i)/4; l++)
        {
            string str = new string(c, i, l);
            if (list.Count > 0 && list[list.Count-1] == str) continue;
            var eList = new List<string>(list);
            eList.Add(str);
            int ans = GetAns(c, N, eList, i + l);
            if (max < ans)
            {
                max = ans;
            }
        }
        return max;
    }

    public static int GetInputInt()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] GetInputsInt()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
    public static List<int> GetInputsIntList()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToList();
    }
    public static long GetInputLong()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] GetInputsLong()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }

}
