

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	}
} Main public static void main(String[] args) {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	} main {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int cardN; cardN int win = 3 win 3 draw = 1; draw 1 String taro[] taro hanako[]; hanako int pointT = 0 pointT 0 pointH = 0; pointH 0 cardN = sc.nextInt() cardN sc.nextInt() sc.nextInt sc taro = new String[cardN] taro new String[cardN] cardN hanako = new String[cardN] hanako new String[cardN] cardN for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		} int i = 0; int i = 0; i 0 i < cardN i cardN i++ i++ i { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		} { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		} taro[i] = sc.next() taro[i] taro i sc.next() sc.next sc hanako[i] = sc.next() hanako[i] hanako i sc.next() sc.next sc int game = taro[i].compareToIgnoreCase(hanako[i]); game taro[i].compareToIgnoreCase(hanako[i]) taro[i].compareToIgnoreCase taro[i] taro i hanako[i] hanako i if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			} game == 0 game 0 {
				pointT += draw;
				pointH += draw;
			} pointT += draw pointT draw pointH += draw pointH draw if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			} game > 0 game 0 {
				pointT += win;
			} pointT += win pointT win {
				pointH += win;
			} pointH += win pointH win System.out.println(pointT + " " + pointH) System.out.println System.out System System.out pointT + " " + pointH pointT + " " + pointH pointT " " pointH String[] args args public class Main{

	public static void main(String[] args) {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	}
} public class Main{

	public static void main(String[] args) {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	}
} Main


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		/*
		 * ?????????????????? [C/C++] ?????????????????? string ???????????°????¨????????????°???
		 * ???????????????????????°??????????????????????????? < ??? > ??¨
		 * ??????????????? == ????????¨???????????¨?????§????????????
		 *
		 * taro hanako
		 *
		 * card N; turn N; Win 3; Draw 1;
		 *
		 */

		Scanner sc = new Scanner(System.in);

		// declear variable
		int cardN; // same turn;
		int win = 3, draw = 1; // point
		String taro[], hanako[]; // player hands
		int pointT = 0, pointH = 0;// player`s point

		/*
		 * Sample Input 3
		 * cat dog
		 * fish fish
		 * lion tiger
		 * Sample Output 1 7
		 */

		// input Card N;
		cardN = sc.nextInt(); // ex : 3
		taro = new String[cardN];
		hanako = new String[cardN];

		// animal name
		for (int i = 0; i < cardN; i++) { // 3
			taro[i] = sc.next();
			hanako[i] = sc.next();

			int game = taro[i].compareToIgnoreCase(hanako[i]);
			if (game == 0) {
				pointT += draw;
				pointH += draw;
			} else if (game > 0) {
				pointT += win;
			} else {
				pointH += win;
			}
		}
		// output
		System.out.println(pointT + " " + pointH);
	}
}