{-# LANGUAGE BangPatterns #-}
module Main where

solve :: Int -> String -> String -> Int
solve !n _ [] = n
solve !n (x : xs) (y : ys)
  | x /= y = solve (n + 2) xs ys
solve !n xs (y : ys) = solve n (y : xs) ys

main = getLine >>= print . solve 0 []

