import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	}

	static boolean VictoryDecision(String str1, String str2) {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	}

	static boolean CharDecision(char a, char b) {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	}

	static boolean VictoryDecision(String str1, String str2) {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	}

	static boolean CharDecision(char a, char b) {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	} main {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int player1 = 0 player1 0 player2 = 0; player2 0 int round = Integer.parseInt(sc.nextLine()); round Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		} int i = 0; int i = 0; i 0 i < round i round i++ i++ i {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		} {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		} String[] cards = sc.nextLine().split("[\\s]+"); cards sc.nextLine().split("[\\s]+") sc.nextLine().split sc.nextLine() sc.nextLine sc "[\\s]+" if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			} cards[0].equals(cards[1]) cards[0].equals cards[0] cards 0 cards[1] cards 1 {
				player1++;
				player2++;
			} player1++ player1 player2++ player2 if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			} VictoryDecision(cards[1], cards[0]) VictoryDecision cards[1] cards 1 cards[0] cards 0 {
				player1 += 3;
			} player1 += 3 player1 3 {
				player2 += 3;
			} player2 += 3 player2 3 System.out.println(player1 + " " + player2) System.out.println System.out System System.out player1 + " " + player2 player1 + " " + player2 player1 " " player2 String[] args args static boolean VictoryDecision(String str1, String str2) {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	} VictoryDecision {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	} int looplimit = str1.length(); looplimit str1.length() str1.length str1 boolean defVictory = true; defVictory true if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		} str1.length() > str2.length() str1.length() str1.length str1 str2.length() str2.length str2 {
			looplimit = str2.length();
			defVictory = false;
		} looplimit = str2.length() looplimit str2.length() str2.length str2 defVictory = false defVictory false for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		} int i = 0; int i = 0; i 0 i < looplimit i looplimit i++ i++ i {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		} {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		} if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			} str1.charAt(i) == str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i {
				continue;
			} continue; {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			} return CharDecision(str1.charAt(i), str2.charAt(i)); CharDecision(str1.charAt(i), str2.charAt(i)) CharDecision str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return defVictory; defVictory String str1 str1 String str2 str2 static boolean CharDecision(char a, char b) {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	} CharDecision {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	} if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		} (int) a < (int) b (int) a (int) b {
			return true;
		} return true; true {
			return false;
		} return false; false char a a char b b public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	}

	static boolean VictoryDecision(String str1, String str2) {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	}

	static boolean CharDecision(char a, char b) {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	}

	static boolean VictoryDecision(String str1, String str2) {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	}

	static boolean CharDecision(char a, char b) {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int player1 = 0, player2 = 0;

		int round = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < round; i++) {
			String[] cards = sc.nextLine().split("[\\s]+");
			if (cards[0].equals(cards[1])) {
				player1++;
				player2++;
			} else if (VictoryDecision(cards[1], cards[0])) {
				player1 += 3;
			} else {
				player2 += 3;
			}

		}

		System.out.println(player1 + " " + player2);

	}

	static boolean VictoryDecision(String str1, String str2) {
		int looplimit = str1.length();
		boolean defVictory = true;
		if (str1.length() > str2.length()) {
			looplimit = str2.length();
			defVictory = false;
		}
		for (int i = 0; i < looplimit; i++) {
			if (str1.charAt(i) == str2.charAt(i)) {
				continue;
			} else {
				return CharDecision(str1.charAt(i), str2.charAt(i));
			}
		}
		return defVictory;
	}

	static boolean CharDecision(char a, char b) {
		if ((int) a < (int) b) {
			return true;
		} else {
			return false;
		}
	}

}

