import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	}
} Main public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	} main {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int T = 0; T 0 int H = 0; H 0 for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		} {
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		} String sT = scan.next(); sT scan.next() scan.next scan String sH = scan.next(); sH scan.next() scan.next scan if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			} sT.compareTo(sH) < 0 sT.compareTo(sH) sT.compareTo sT sH 0 {
				H += 3;
			} H += 3 H 3 if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			} sT.compareTo(sH) > 0 sT.compareTo(sH) sT.compareTo sT sH 0 {
				T += 3;
			} T += 3 T 3 {
				T++;
				H++;
			} T++ T H++ H System.out.printf("%d %d\n", T, H) System.out.printf System.out System System.out "%d %d\n" T H String[] args args public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	}
} public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if(sT.compareTo(sH) < 0){
				H += 3;
			} else if(sT.compareTo(sH) > 0){
				T += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	}
}