class String
  def palindrome?()
    return self == self.reverse
  end
end


if __FILE__ == $0
  count = 0
  while line = gets
    if line.rstrip.palindrome?
      count += 1
    end
  end
  puts count
end