let is_palindrome lst = lst = List.rev lst
  
let rec loop cnt =
  try
    let sl = Str.split (Str.regexp "") (read_line ()) in
    if is_palindrome sl then loop (cnt + 1) else loop cnt
  with
    End_of_file -> Printf.printf "%d\n" cnt

let _ = loop 0