import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	}
} Main public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	} main {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] k = new String[Integer.parseInt(line)]; k new String[Integer.parseInt(line)] Integer.parseInt(line) Integer.parseInt Integer line for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		} int i = 0; int i = 0; i 0 i < k.length i k.length k k.length i++ i++ i {
			k[i] = sc.nextLine();
		} {
			k[i] = sc.nextLine();
		} k[i] = sc.nextLine() k[i] k i sc.nextLine() sc.nextLine sc int tarou = 0; tarou 0 int hanako = 0; hanako 0 for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		} String string k {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		} {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		} String[] tehuda = string.split(" "); tehuda string.split(" ") string.split string " " if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			} tehuda[0].compareToIgnoreCase(tehuda[1]) > 0 tehuda[0].compareToIgnoreCase(tehuda[1]) tehuda[0].compareToIgnoreCase tehuda[0] tehuda 0 tehuda[1] tehuda 1 0 {
				tarou += 3;
			} tarou += 3 tarou 3 if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			} tehuda[0].compareToIgnoreCase(tehuda[1]) < 0 tehuda[0].compareToIgnoreCase(tehuda[1]) tehuda[0].compareToIgnoreCase tehuda[0] tehuda 0 tehuda[1] tehuda 1 0 {
				hanako += 3;
			} hanako += 3 hanako 3 {
				tarou += 1;
				hanako += 1;
			} tarou += 1 tarou 1 hanako += 1 hanako 1 System.out.println(tarou+" "+hanako) System.out.println System.out System System.out tarou+" "+hanako tarou+" "+hanako tarou " " hanako String[] arges arges public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	}
} public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	}
} Main
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = new String[Integer.parseInt(line)];

		for (int i = 0; i < k.length; i++) {
			k[i] = sc.nextLine();
		}
		int tarou = 0;
		int hanako = 0;
		for (String string : k) {
			String[] tehuda = string.split(" ");

			if (tehuda[0].compareToIgnoreCase(tehuda[1]) > 0) {
				tarou += 3;
			} else if (tehuda[0].compareToIgnoreCase(tehuda[1]) < 0) {
				hanako += 3;
			} else {
				tarou += 1;
				hanako += 1;
			}
		}System.out.println(tarou+" "+hanako);
	}
}