#include <iostream>
#include <string>
using namespace std;
int main() {
	int n;
	cin >> n;
	int ts = 0, hs = 0;
	for (int i = 0; i < n; i++) {
		string t, h;
		cin >> t >> h;
		if (t == h) {
			ts += 1;
			hs += 1;
		}
		if (t > h) {
			ts += 3;
		}
		if (t < h) {
			hs += 3;
		}
	}
	cout << ts << " " << hs << endl;
	return 0;
}
