import java.io.*;
 
class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String taro, hanako, str;
        int st=0, sh=0;
        int n = Integer.parseInt(br.readLine());
        for(int i=0; i<n; i++) {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
} import java.io.*; io.* java class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String taro, hanako, str;
        int st=0, sh=0;
        int n = Integer.parseInt(br.readLine());
        for(int i=0; i<n; i++) {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String taro, hanako, str;
        int st=0, sh=0;
        int n = Integer.parseInt(br.readLine());
        for(int i=0; i<n; i++) {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String taro, hanako, str;
        int st=0, sh=0;
        int n = Integer.parseInt(br.readLine());
        for(int i=0; i<n; i++) {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String taro taro hanako hanako str; str int st=0 st 0 sh=0; sh 0 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i=0; i<n; i++) {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        } {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        } str = br.readLine() str br.readLine() br.readLine br taro = str.substring(0, str.indexOf(' ')) taro str.substring(0, str.indexOf(' ')) str.substring str 0 str.indexOf(' ') str.indexOf str ' ' hanako = str.substring(str.indexOf(' ')+1) hanako str.substring(str.indexOf(' ')+1) str.substring str str.indexOf(' ')+1 str.indexOf(' ') str.indexOf str ' ' 1 if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; } taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 sh += 3 sh 3 if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; } taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 st+=3 st 3 { st++; sh++; } st++ st sh++ sh System.out.println(st + " " + sh) System.out.println System.out System System.out st + " " + sh st + " " + sh st " " sh String[] args args
import java.io.*;
 
class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String taro, hanako, str;
        int st=0, sh=0;
        int n = Integer.parseInt(br.readLine());
        for(int i=0; i<n; i++) {
            str = br.readLine();
            taro = str.substring(0, str.indexOf(' '));
            hanako = str.substring(str.indexOf(' ')+1);
            if(taro.compareTo(hanako) < 0) sh += 3;
            else if(taro.compareTo(hanako) > 0) st+=3;
            else { st++; sh++; }
        }
        System.out.println(st + " " + sh);
    }
}