import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	} main {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int Tpt = 0; Tpt 0 int Hpt = 0; Hpt 0 for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		} {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		} String string = sc.nextLine(); string sc.nextLine() sc.nextLine sc String[] str = string.split(" "); str string.split(" ") string.split string " " String T = str[0]; T str[0] str 0 String H = str[1]; H str[1] str 1 if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			} T.compareTo(H) == 0 T.compareTo(H) T.compareTo T H 0 {
				Tpt += 1;
				Hpt += 1;

			} Tpt += 1 Tpt 1 Hpt += 1 Hpt 1 if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			} T.compareTo(H) > 0 T.compareTo(H) T.compareTo T H 0 {
				Tpt += 3;

			} Tpt += 3 Tpt 3 {
				Hpt += 3;

			} Hpt += 3 Hpt 3 System.out.println(Tpt + " " + Hpt) System.out.println System.out System System.out Tpt + " " + Hpt Tpt + " " + Hpt Tpt " " Hpt String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int n = Integer.parseInt(line);

		int Tpt = 0;
		int Hpt = 0;
		for (int i = 0; i < n; i++) {
			String string = sc.nextLine();
			String[] str = string.split(" ");
			String T = str[0];
			String H = str[1];
			if (T.compareTo(H) == 0) {
				Tpt += 1;
				Hpt += 1;

			} else if (T.compareTo(H) > 0) {
				Tpt += 3;

			} else {
				Hpt += 3;

			}

		}
		System.out.println(Tpt + " " + Hpt);
	}

}