import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    }
} Main public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    } main {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int i i n n a=0 a 0 b=0; b 0 String sa sa sb; sb n=scan.nextInt() n scan.nextInt() scan.nextInt scan for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        } i=0; i=0 i 0 i<n i n i++ i++ i {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        } {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        } sa=scan.next() sa scan.next() scan.next scan sb=scan.next() sb scan.next() scan.next scan if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	} sa.compareTo(sb)>0 sa.compareTo(sb) sa.compareTo sa sb 0 {
        		a+=3;
        	} a+=3 a 3 if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	} sa.compareTo(sb)<0 sa.compareTo(sb) sa.compareTo sa sb 0 {
        		b+=3;
        	} b+=3 b 3 if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	} sa.compareTo(sb)==0 sa.compareTo(sb) sa.compareTo sa sb 0 {
        		a+=1;
        		b+=1;
        	} a+=1 a 1 b+=1 b 1 System.out.println(a+" "+b) System.out.println System.out System System.out a+" "+b a+" "+b a " " b String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n,a=0,b=0;
        String sa,sb;
        n=scan.nextInt();
        for(i=0;i<n;i++) {
        	sa=scan.next();
        	sb=scan.next();
        	if(sa.compareTo(sb)>0) {
        		a+=3;
        	}
        	else if(sa.compareTo(sb)<0) {
        		b+=3;
        	}
        	else if(sa.compareTo(sb)==0) {
        		a+=1;
        		b+=1;
        	}
        }
        System.out.println(a+" "+b);
    }
}
