import java.io.*;
import java.util.Arrays;
class Main{
    public static void main(String[] args) throws IOException {
        int i,n,taro=0,hanako=0; 
        String[] str = new String[200];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        n = Integer.parseInt(in.readLine());
        for(i=0;i<n;i++){
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        }
        System.out.println(taro+" "+hanako);
        System.out.flush();
    }
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main{
    public static void main(String[] args) throws IOException {
        int i,n,taro=0,hanako=0; 
        String[] str = new String[200];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        n = Integer.parseInt(in.readLine());
        for(i=0;i<n;i++){
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        }
        System.out.println(taro+" "+hanako);
        System.out.flush();
    }
} Main public static void main(String[] args) throws IOException {
        int i,n,taro=0,hanako=0; 
        String[] str = new String[200];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        n = Integer.parseInt(in.readLine());
        for(i=0;i<n;i++){
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        }
        System.out.println(taro+" "+hanako);
        System.out.flush();
    } main {
        int i,n,taro=0,hanako=0; 
        String[] str = new String[200];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        n = Integer.parseInt(in.readLine());
        for(i=0;i<n;i++){
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        }
        System.out.println(taro+" "+hanako);
        System.out.flush();
    } int i i n n taro=0 taro 0 hanako=0; hanako 0 String[] str = new String[200]; str new String[200] 200 BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) n = Integer.parseInt(in.readLine()) n Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in for(i=0;i<n;i++){
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        } i=0; i=0 i 0 i<n i n i++ i++ i {
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        } {
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        } str = in.readLine().split(" ",-1) str in.readLine().split(" ",-1) in.readLine().split in.readLine() in.readLine in " " -1 1 if(str[0].compareToIgnoreCase(str[1])>0) taro+=3; str[0].compareToIgnoreCase(str[1])>0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 taro+=3 taro 3 if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            } str[0].compareToIgnoreCase(str[1])<0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 hanako+=3 hanako 3 if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            } str[0].compareToIgnoreCase(str[1])==0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 {
                taro+=1;
                hanako+=1;
            } taro+=1 taro 1 hanako+=1 hanako 1 System.out.println(taro+" "+hanako) System.out.println System.out System System.out taro+" "+hanako taro+" "+hanako taro " " hanako System.out.flush() System.out.flush System.out System System.out String[] args args
import java.io.*;
import java.util.Arrays;
class Main{
    public static void main(String[] args) throws IOException {
        int i,n,taro=0,hanako=0; 
        String[] str = new String[200];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        n = Integer.parseInt(in.readLine());
        for(i=0;i<n;i++){
            str = in.readLine().split(" ",-1);
            if(str[0].compareToIgnoreCase(str[1])>0) taro+=3;
            if(str[0].compareToIgnoreCase(str[1])<0) hanako+=3;
            else if(str[0].compareToIgnoreCase(str[1])==0){
                taro+=1;
                hanako+=1;
            }
        }
        System.out.println(taro+" "+hanako);
        System.out.flush();
    }
}