import java.util.Scanner;

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

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

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

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

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

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

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

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int gameCount = Integer.parseInt(sc.nextLine()); gameCount Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int totalPointTaro = 0; totalPointTaro 0 int totalPointHanako = 0; totalPointHanako 0 for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		} int i = 0; int i = 0; i 0 i < gameCount i gameCount i++ i++ i {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		} {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		} String[] cards = sc.nextLine().split(" "); cards sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			} cards[0].compareTo(cards[1]) == 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} totalPointTaro += 1 totalPointTaro 1 totalPointHanako += 1 totalPointHanako 1 if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			} cards[0].compareTo(cards[1]) > 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
				totalPointTaro += 3;
			} totalPointTaro += 3 totalPointTaro 3 {
				totalPointHanako += 3;
			} totalPointHanako += 3 totalPointHanako 3 sc.close() sc.close sc System.out.printf("%d %d\n", totalPointTaro, totalPointHanako) System.out.printf System.out System System.out "%d %d\n" totalPointTaro totalPointHanako String[] args args public class Main {
	public static void main(String[] args ) {
		Scanner sc = new Scanner(System.in);

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

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

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

	}
} Main
import java.util.Scanner;

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

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

		int totalPointTaro = 0;
		int totalPointHanako = 0;

		for (int i = 0; i < gameCount; i++) {
			String[] cards = sc.nextLine().split(" ");
			if (cards[0].compareTo(cards[1]) == 0 ) {
				totalPointTaro += 1;
				totalPointHanako += 1;
			} else if (cards[0].compareTo(cards[1]) > 0) {
				totalPointTaro += 3;
			} else {
				totalPointHanako += 3;
			}

		}
		sc.close();

		System.out.printf("%d %d\n", totalPointTaro, totalPointHanako);

	}
}
