import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	}

	public static String input() {

		return scanner.nextLine();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

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

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	}

	public static String input() {

		return scanner.nextLine();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

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

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	} main {

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	} int n = Integer.parseInt(input()); n Integer.parseInt(input()) Integer.parseInt Integer input() input int taroScore = 0; taroScore 0 int hanakoScore = 0; hanakoScore 0 for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		} {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		} String[] tempList = input().split(" "); tempList input().split(" ") input().split input() input " " if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			} 0 < tempList[0].compareToIgnoreCase(tempList[1]) 0 tempList[0].compareToIgnoreCase(tempList[1]) tempList[0].compareToIgnoreCase tempList[0] tempList 0 tempList[1] tempList 1 {

				taroScore += 3;

			} taroScore += 3 taroScore 3 if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			} tempList[0].compareToIgnoreCase(tempList[1]) < 0 tempList[0].compareToIgnoreCase(tempList[1]) tempList[0].compareToIgnoreCase tempList[0] tempList 0 tempList[1] tempList 1 0 {

				hanakoScore += 3;

			} hanakoScore += 3 hanakoScore 3 if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			} tempList[0].compareToIgnoreCase(tempList[1]) == 0 tempList[0].compareToIgnoreCase(tempList[1]) tempList[0].compareToIgnoreCase tempList[0] tempList 0 tempList[1] tempList 1 0 {

				taroScore += 1;
				hanakoScore += 1;

			} taroScore += 1 taroScore 1 hanakoScore += 1 hanakoScore 1 System.out.println(taroScore + " " + hanakoScore) System.out.println System.out System System.out taroScore + " " + hanakoScore taroScore + " " + hanakoScore taroScore " " hanakoScore close() close String[] args args public static String input() {

		return scanner.nextLine();

	} input {

		return scanner.nextLine();

	} return scanner.nextLine(); scanner.nextLine() scanner.nextLine scanner public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	} close {

		if (scanner != null) {

			scanner.close();

		}
	} if (scanner != null) {

			scanner.close();

		} scanner != null scanner null {

			scanner.close();

		} scanner.close() scanner.close scanner public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	}

	public static String input() {

		return scanner.nextLine();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	}

	public static String input() {

		return scanner.nextLine();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = Integer.parseInt(input());
		int taroScore = 0;
		int hanakoScore = 0;

		for (int i = 0; i < n; i++) {

			String[] tempList = input().split(" ");

			if (0 < tempList[0].compareToIgnoreCase(tempList[1])) {

				taroScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) < 0) {

				hanakoScore += 3;

			} else if (tempList[0].compareToIgnoreCase(tempList[1]) == 0) {

				taroScore += 1;
				hanakoScore += 1;

			}
		}

		System.out.println(taroScore + " " + hanakoScore);

		close();

	}

	public static String input() {

		return scanner.nextLine();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
}