import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int point1 = 0;
		int point2 = 0;

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



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

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int point1 = 0;
		int point2 = 0;

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



	} main {
		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int point1 = 0;
		int point2 = 0;

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = sc.nextInt(); count sc.nextInt() sc.nextInt sc int point1 = 0; point1 0 int point2 = 0; point2 0 for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		} {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		} String card1 = sc.next(); card1 sc.next() sc.next sc String card2 = sc.next(); card2 sc.next() sc.next sc if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			} card1.compareTo(card2) > 0 card1.compareTo(card2) card1.compareTo card1 card2 0 {
				point1 += 3;
			} point1 += 3 point1 3 if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			} card1.compareTo(card2) < 0 card1.compareTo(card2) card1.compareTo card1 card2 0 {
				point2 += 3;

			} point2 += 3 point2 3 {
				point1 += 1;
				point2 += 1;
			} point1 += 1 point1 1 point2 += 1 point2 1 System.out.println(point1 + " " + point2) System.out.println System.out System System.out point1 + " " + point2 point1 + " " + point2 point1 " " point2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int point1 = 0;
		int point2 = 0;

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int point1 = 0;
		int point2 = 0;

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int point1 = 0;
		int point2 = 0;

		for(int i = 0;i < count;i++) {
			String card1 = sc.next();
			String card2 = sc.next();
			if(card1.compareTo(card2) > 0){
				point1 += 3;
			} else if (card1.compareTo(card2) < 0) {
				point2 += 3;

			} else {
				point1 += 1;
				point2 += 1;
			}

		}
		System.out.println(point1 + " " + point2);



	}
}