package main import ( "bufio" "fmt" "os" ) func main() { sc := bufio.NewScanner(os.Stdin) sc.Scan() row := sc.Text() max := 1 if len(row) == 2 { fmt.Println(1) return } for i := 0; i < len(row)-1; i++ { for j := i + 1; j < len(row); j++ { diff := (j - i) + 1 for k := 0; k <= diff/2; k++ { if row[i+k] != row[j-k] { diff = 0 break } } if diff > max { max = diff } } } fmt.Println(max) }