import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	}
	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	}
	public static void main(String[] args) {
		new Main().run();
	}
} Main void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	} run {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int tscore = 0; tscore 0 int hscore = 0; hscore 0 for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		} {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		} String tcard = scan.next(); tcard scan.next() scan.next scan String hcard = scan.next(); hcard scan.next() scan.next scan if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			} tcard.compareToIgnoreCase(hcard) > 0 tcard.compareToIgnoreCase(hcard) tcard.compareToIgnoreCase tcard hcard 0 {
				tscore += 3;
			} tscore += 3 tscore 3 if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			} tcard.compareToIgnoreCase(hcard) < 0 tcard.compareToIgnoreCase(hcard) tcard.compareToIgnoreCase tcard hcard 0 {
				hscore += 3;
			} hscore += 3 hscore 3 {
				tscore += 1;
				hscore += 1;
			} tscore += 1 tscore 1 hscore += 1 hscore 1 System.out.printf("%d %d\n", tscore, hscore) System.out.printf System.out System System.out "%d %d\n" tscore hscore public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	}
	public static void main(String[] args) {
		new Main().run();
	}
} public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	}
	public static void main(String[] args) {
		new Main().run();
	}
} Main
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int tscore = 0;
		int hscore = 0;
		for (int i = 0; i < n; i++) {
			String tcard = scan.next();
			String hcard = scan.next();
			if (tcard.compareToIgnoreCase(hcard) > 0) {
				tscore += 3;
			} else if (tcard.compareToIgnoreCase(hcard) < 0) {
				hscore += 3;
			} else {
				tscore += 1;
				hscore += 1;
			}
		}
		System.out.printf("%d %d\n", tscore, hscore);
	}
	public static void main(String[] args) {
		new Main().run();
	}
}