Jameson loves to eat cakes from "Feed the Young Master (餵公子吃餅)" since the cakes give him wings. Nevertheless, the cakes bring side effects such as being prone to colds and insomnia.
The cakes come in 26 flavors (a-z). A package of cakes can have a random number of each flavor. Also, the arrangement of cakes in a package is random.
Today, Jameson wants to have some cakes before he sleeps. To avoid eating too much, he will only pick consecutive cakes with the same flavors. However, since he loves the cakes too much, he allowed himself to swap two cakes before picking consecutive same-flavor cakes.
Please help Jameson to find out the maximum number of cakes he can eat.
Input contains one line with a string text, the arrangement of cakes.
Output contains one line with an integer, the maximum number of cakes Jameson can eat.