import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	}
	
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	}
	
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int pntT = 0; pntT 0 int pntH = 0; pntH 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		} {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		} String strT = sc.next(); strT sc.next() sc.next sc String strH = sc.next(); strH sc.next() sc.next sc if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			} strT.compareTo(strH) > 0 strT.compareTo(strH) strT.compareTo strT strH 0 {
				pntT += 3;
			} pntT += 3 pntT 3 if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			} strT.compareTo(strH) == 0 strT.compareTo(strH) strT.compareTo strT strH 0 {
				pntT += 1;
				pntH += 1;
			} pntT += 1 pntT 1 pntH += 1 pntH 1 if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			} strT.compareTo(strH) < 0 strT.compareTo(strH) strT.compareTo strT strH 0 {
				pntH += 3;
			} pntH += 3 pntH 3 System.out.println(pntT + " " + pntH) System.out.println System.out System System.out pntT + " " + pntH pntT + " " + pntH pntT " " pntH sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	}
	
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	}
	
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int pntT = 0;
		int pntH = 0;
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			String strT = sc.next();
			String strH = sc.next();
			if(strT.compareTo(strH) > 0 ) {
				pntT += 3;
			} else if(strT.compareTo(strH) == 0 ) {
				pntT += 1;
				pntH += 1;
			} else if(strT.compareTo(strH) < 0 ) {
				pntH += 3;
			}
		}
		System.out.println(pntT + " " + pntH);
		
		sc.close();
	}
	
}
