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

namespace MyApp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string wrd = Console.ReadLine();
            int n = wrd.Length;
            char[] ltr = new char[n];
            int jj = 0;
            foreach(char c in wrd)
            {
                ltr[jj] = c;
                jj++;
            }
            int score = 0; //name score
            int count = 0; //number of letters in line
            int line = 0; //number of current line
            List<char> been = new List<char>();
            List<string> lines = new List<string>();
            int start = 0; //position of last char of n - 2 word
            bool first_to_check = true;
            for (int i = 0; i < n; i++)
            {
                if(count < 2)
                {
                    //add 2 first letters in line
                    if (count == 0) lines.Add((ltr[i]).ToString());
                    else lines[line] += ltr[i];
                    if(line > 0)
                    {

                    }
                    count++;
                }
                else
                {
                    bool exist = false;
                    for (int j = start; j < i; j++)
                    {
                        if(ltr[i] == ltr[j])
                        {
                            exist = true;
                            bool used = false;
                            foreach (char c in been) if (c == ltr[i]) used = true;
                            if (!used)
                            {
                                line++;
                                if (first_to_check)
                                {
                                    lines.Add((ltr[i]).ToString());
                                    count = 1;
                                    first_to_check = false;
                                }
                                else lines[line] += ltr[i];

                                score++;
                            }
                        }
                    }
                    if(!exist) lines[line] += ltr[i];
                }
            }
            Console.WriteLine(score);
        }
    }
}