
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	} main {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int sum1 = 0; sum1 0 int sum2 = 0; sum2 0 for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		} {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		} String b = scanner.next(); b scanner.next() scanner.next scanner String c = scanner.next(); c scanner.next() scanner.next scanner if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			} b.compareTo(c) > 0 b.compareTo(c) b.compareTo b c 0 sum1 += 3 sum1 3 if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			} b.compareTo(c) < 0 b.compareTo(c) b.compareTo b c 0 sum2 += 3 sum2 3 {
				sum1 += 1;
				sum2 += 1;
			} sum1 += 1 sum1 1 sum2 += 1 sum2 1 System.out.println(String.format("%d %d", sum1, sum2)) System.out.println System.out System System.out String.format("%d %d", sum1, sum2) String.format String "%d %d" sum1 sum2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int sum1 = 0;
		int sum2 = 0;

		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			String c = scanner.next();
			if (b.compareTo(c) > 0)
				sum1 += 3;
			else if (b.compareTo(c) < 0)
				sum2 += 3;
			else {
				sum1 += 1;
				sum2 += 1;
			}
		}
		System.out.println(String.format("%d %d", sum1, sum2));
	}
}