import Foundation

let s = readLine()!
var c = s.count
var ans = 0
for i in (2...c).reversed() {
  if i % 2 != 0 { continue }
  let strl = s.prefix(i / 2)
  let l = s.index(s.startIndex, offsetBy: i / 2)
  let r = s.index(s.startIndex, offsetBy: i)
  let strr = s[l..<r]
  if strl == strr && i != s.count{
    ans = i
    break
  }
}
print(ans)