import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		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 n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taroP = 0; taroP 0 int hanaP = 0; hanaP 0 for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		} {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		} String taro = sc.next(); taro sc.next() sc.next sc String hana = sc.next(); hana sc.next() sc.next sc int result = taro.compareTo(hana); result taro.compareTo(hana) taro.compareTo taro hana if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			} result < 0 result 0 {
				hanaP += 3;
			} hanaP += 3 hanaP 3 if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			} result > 0 result 0 {
				taroP += 3;
			} taroP += 3 taroP 3 {
				taroP++;
				hanaP++;
			} taroP++ taroP hanaP++ hanaP System.out.println(taroP + " " + hanaP) System.out.println System.out System System.out taroP + " " + hanaP taroP + " " + hanaP taroP " " hanaP sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int taroP = 0;
		int hanaP = 0;
		for (int i = 0; i < n; i++) {
			String taro = sc.next();
			String hana = sc.next();
			int result = taro.compareTo(hana);
			if (result < 0) {
				hanaP += 3;
			} else if (result > 0) {
				taroP += 3;
			} else {
				taroP++;
				hanaP++;
			}
		}
		System.out.println(taroP + " " + hanaP);
		
		sc.close();
	}
}