#include<iostream>
#include<string>
using namespace std;
int main(){
    string a,b;
    int n,s1=0,s2=0;
    cin>>n;
    while(n--){
        cin>>a>>b;
        if(a>b) s1+=3;
        else if(a<b) s2+=3;
        else s1++,s2++;
    }
    cout<<s1<<" "<<s2<<endl;
    return 0;
}
