import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		}
} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		} main {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int x=scan.nextInt(); x scan.nextInt() scan.nextInt scan int hanako=0 hanako 0 tarou=0; tarou 0 for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			} int i=0; int i=0; i 0 i<x i x i++ i++ i {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			} {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			} String str1=scan.next(); str1 scan.next() scan.next scan String str2=scan.next(); str2 scan.next() scan.next scan if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				} str1.compareTo(str2)>0 str1.compareTo(str2) str1.compareTo str1 str2 0 {
					tarou +=3;
				} tarou +=3 tarou 3 if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				} str1.compareTo(str2)<0 str1.compareTo(str2) str1.compareTo str1 str2 0 {
					hanako +=3;
				} hanako +=3 hanako 3 {
					hanako +=1;
					tarou +=1;
				} hanako +=1 hanako 1 tarou +=1 tarou 1 System.out.println(tarou+" "+hanako) System.out.println System.out System System.out tarou+" "+hanako tarou+" "+hanako tarou " " hanako scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		}
} public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int x=scan.nextInt();
			int hanako=0,tarou=0;
			for(int i=0;i<x;i++) {
				String str1=scan.next();
				String str2=scan.next();
				if(str1.compareTo(str2)>0) {
					tarou +=3;
				}else if(str1.compareTo(str2)<0) {
					hanako +=3;
				}else {
					hanako +=1;
					tarou +=1;
				}
			}
			System.out.println(tarou+" "+hanako);
			scan.close();
		}
}
