#include<iostream>
#include<sstream>
#include<list>

using namespace std;

int main(){
	ostringstream out;
	list<char> list;
	int n=0;

	for(string line;cin >> line;){
		list.clear();
		for(int i=0;i<line.length();i++)
			list.push_back(line[i]);
		while(list.size()>1){
			if(list.back()!=list.front())
				break;
			list.pop_front();
			list.pop_back();
		}
		if(list.size()<=1)
			n++;
	}
	out << n << endl;

	cout << out.str();
	return 0;
}