s = gets.chomp!

ans = 0
until s == "" do
    c = s.slice!(0,3) + "01"
    if c[0] == c[1] || c[1] == c[2] || c[2] == c[0]
        ans += 2
    else
        ans += c.length - 2
    end
    #p c
end

puts ans