import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	}
} Main public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	} main {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	} try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		} {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int t = 0; t 0 int h = 0; h 0 for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			} {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			} String taro = sc.next(); taro sc.next() sc.next sc String hana = sc.next(); hana sc.next() sc.next sc if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				} taro.compareTo(hana) > 0 taro.compareTo(hana) taro.compareTo taro hana 0 {
					t += 3;
				} t += 3 t 3 if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				} hana.compareTo(taro) > 0 hana.compareTo(taro) hana.compareTo hana taro 0 {
					h += 3;
				} h += 3 h 3 {
					t += 1;
					h += 1;
				} t += 1 t 1 h += 1 h 1 System.out.println(t + " " + h) System.out.println System.out System System.out t + " " + h t + " " + h t " " h String[] args args public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int a = sc.nextInt();
			int t = 0;
			int h = 0;

			for (int i = 0; i < a; i++) {
				String taro = sc.next();
				String hana = sc.next();

				if (taro.compareTo(hana) > 0) {
					t += 3;
				} else if (hana.compareTo(taro) > 0) {
					h += 3;
				} else {
					t += 1;
					h += 1;
				}
			}
			System.out.println(t + " " + h);
		}
	}
}
