import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	}
} Main public static void main(String[] args){
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	} main {
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	} Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int count count Judg Judg taroP=0 taroP 0 hanakoP=0; hanakoP 0 String taroC taroC hanakoC; hanakoC count= sc.nextInt() count sc.nextInt() sc.nextInt sc for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		} int i =0; int i =0; i 0 i<count i count i++ i++ i {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		} {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		} taroC = sc.next() taroC sc.next() sc.next sc hanakoC = sc.next() hanakoC sc.next() sc.next sc Judg = taroC.compareTo(hanakoC) Judg taroC.compareTo(hanakoC) taroC.compareTo taroC hanakoC if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			} Judg==0 Judg 0 {
				taroP++;
				hanakoP++;
			} taroP++ taroP hanakoP++ hanakoP if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			} Judg<0 Judg 0 {
				hanakoP +=3;
			} hanakoP +=3 hanakoP 3 if(Judg>0) {
				taroP +=3;
			} Judg>0 Judg 0 {
				taroP +=3;
			} taroP +=3 taroP 3 System.out.println(taroP+" "+hanakoP) System.out.println System.out System System.out taroP+" "+hanakoP taroP+" "+hanakoP taroP " " hanakoP String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new java.util.Scanner(System.in);
		int count,Judg,taroP=0,hanakoP=0;
		String taroC,hanakoC;
		count= sc.nextInt();

		for(int i =0; i<count; i++) {
			taroC = sc.next();
			hanakoC = sc.next();
			Judg = taroC.compareTo(hanakoC);
			if(Judg==0) {
				taroP++;
				hanakoP++;
			}else if(Judg<0) {
				hanakoP +=3;
			}else if(Judg>0) {
				taroP +=3;
			}
		}
		System.out.println(taroP+" "+hanakoP);
	}
}

