import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	}

	private static int[] fight(int[] scores, String[] cards) {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	}

}
 import java.util.Scanner; Scanner java.util public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	}

	private static int[] fight(int[] scores, String[] cards) {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	}

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	} main {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	} int[] scores = new int[2]; scores new int[2] 2 String[] cards = new String[2]; cards new String[2] 2 String str = null; str null int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		} {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		} str = sc.nextLine() str sc.nextLine() sc.nextLine sc cards = str.split(" ") cards str.split(" ") str.split str " " scores = fight(scores, cards) scores fight(scores, cards) fight scores cards System.out.println(scores[0] + " " + scores[1]) System.out.println System.out System System.out scores[0] + " " + scores[1] scores[0] + " " + scores[1] scores[0] scores 0 " " scores[1] scores 1 sc.close() sc.close sc String[] args args private static int[] fight(int[] scores, String[] cards) {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	} fight {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	} if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			} cards[0].compareTo(cards[1]) > 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
				scores[0] += 3;
			} scores[0] += 3 scores[0] scores 0 3 if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			} cards[0].compareTo(cards[1]) < 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
				scores[1] += 3;
			} scores[1] += 3 scores[1] scores 1 3 {
				scores[0]++;
				scores[1]++;
			} scores[0]++ scores[0] scores 0 scores[1]++ scores[1] scores 1 return scores; scores int[] scores scores String[] cards cards public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	}

	private static int[] fight(int[] scores, String[] cards) {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	}

} public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	}

	private static int[] fight(int[] scores, String[] cards) {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	}

} Main
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] scores = new int[2];
		String[] cards = new String[2];
		String str = null;

		int n = Integer.parseInt(sc.nextLine());

		for (int i = 0; i < n; i++) {
			str = sc.nextLine();
			cards = str.split(" ");
			scores = fight(scores, cards);
		}

			System.out.println(scores[0] + " " + scores[1]);


		sc.close();

	}

	private static int[] fight(int[] scores, String[] cards) {

			if (cards[0].compareTo(cards[1]) > 0) {
				scores[0] += 3;
			} else if (cards[0].compareTo(cards[1]) < 0) {
				scores[1] += 3;
			} else {
				scores[0]++;
				scores[1]++;
			}

		return scores;


	}

}

