import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		String[] a;
        int r=0,t=0,h=0;
        for(int i=0;i<n;i++){
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        }
		System.out.println(t+" "+h);
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		String[] a;
        int r=0,t=0,h=0;
        for(int i=0;i<n;i++){
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        }
		System.out.println(t+" "+h);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		String[] a;
        int r=0,t=0,h=0;
        for(int i=0;i<n;i++){
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        }
		System.out.println(t+" "+h);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		String[] a;
        int r=0,t=0,h=0;
        for(int i=0;i<n;i++){
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        }
		System.out.println(t+" "+h);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n=Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] a; a int r=0 r 0 t=0 t 0 h=0; h 0 for(int i=0;i<n;i++){
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        } {
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        } a=br.readLine().split(" ") a br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " r=a[0].compareTo(a[1]) r a[0].compareTo(a[1]) a[0].compareTo a[0] a 0 a[1] a 1 if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; } r>0 r 0 { t+=3;
            } t+=3 t 3 if(r<0){ h+=3;
            }else{ t++; h++; } r<0 r 0 { h+=3;
            } h+=3 h 3 { t++; h++; } t++ t h++ h System.out.println(t+" "+h) System.out.println System.out System System.out t+" "+h t+" "+h t " " h String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		String[] a;
        int r=0,t=0,h=0;
        for(int i=0;i<n;i++){
            a=br.readLine().split(" ");
            r=a[0].compareTo(a[1]);
            if(r>0){ t+=3;
            }else if(r<0){ h+=3;
            }else{ t++; h++; }
        }
		System.out.println(t+" "+h);
	}
}