import java.util.Scanner;

public class Main {

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

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	}

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

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

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	}

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

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	} main {
		Scanner scan = new Scanner(System.in);

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		} true {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		} int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int pointT = 0 pointT 0 pointH = 0; pointH 0 for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			} {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			} String T = scan.next(); T scan.next() scan.next scan String H = scan.next(); H scan.next() scan.next scan if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3; T.compareTo(H) < 0 T.compareTo(H) T.compareTo T H 0 pointH += 3 pointH 3 if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3; T.compareTo(H) == 0 T.compareTo(H) T.compareTo T H 0 {
					pointT++;
					pointH++;
				} pointT++ pointT pointH++ pointH pointT += 3 pointT 3 System.out.println(pointT + " " + pointH) System.out.println System.out System System.out pointT + " " + pointH pointT + " " + pointH pointT " " pointH break; scan.close() scan.close scan System.exit(0) System.exit System 0 String[] args args public class Main {

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

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	}

} public class Main {

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

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	}

} Main
import java.util.Scanner;

public class Main {

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

		while (true) {
			int n = scan.nextInt();
			int pointT = 0, pointH = 0;

			for (int i = 0; i < n; i++) {
				String T = scan.next();
				String H = scan.next();
				if (T.compareTo(H) < 0)
					pointH += 3;
				else if (T.compareTo(H) == 0) {
					pointT++;
					pointH++;
				} else
					pointT += 3;
			}
			System.out.println(pointT + " " + pointH);
			break;
		}
		scan.close();
		System.exit(0);
	}

}