import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	}
} 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();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	} main {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc int[] score = new int[2]; score new int[2] 2 for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		} {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		} String[] taro_hana = sc.nextLine().split(" "); taro_hana sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int res = taro_hana[0].compareTo(taro_hana[1]); res taro_hana[0].compareTo(taro_hana[1]) taro_hana[0].compareTo taro_hana[0] taro_hana 0 taro_hana[1] taro_hana 1 if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			} res == 0 res 0 {
				score[0] += 1;
				score[1] += 1;
			} score[0] += 1 score[0] score 0 1 score[1] += 1 score[1] score 1 1 if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			} res > 0 res 0 {
				score[0] += 3;
			} score[0] += 3 score[0] score 0 3 {
				score[1] += 3;
			} score[1] += 3 score[1] score 1 3 sc.close() sc.close sc System.out.println(score[0] + " " + score[1]) System.out.println System.out System System.out score[0] + " " + score[1] score[0] + " " + score[1] score[0] score 0 " " score[1] score 1 String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		int[] score = new int[2];
		for (int i = 0; i < n; i++) {

			String[] taro_hana = sc.nextLine().split(" ");

			int res = taro_hana[0].compareTo(taro_hana[1]);

			if(res == 0) {
				score[0] += 1;
				score[1] += 1;
			} else if(res > 0) {
				score[0] += 3;
			} else {
				score[1] += 3;
			}
		}
		sc.close();

		System.out.println(score[0] + " " + score[1]);
	}
}