#include <bits/stdc++.h>
using namespace std;

int n, a, b;
string c, d;

int main() {
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> c >> d;
        if (c > d) a+=3;
        else if (c < d) b+=3;
        else {
            a++; b++;
        }
    }
    cout << a << " " << b << endl;
}
