import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int tSum = 0; tSum 0 int hSum = 0; hSum 0 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		} {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		} String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			} input[0].compareTo(input[1]) > 0 input[0].compareTo(input[1]) input[0].compareTo input[0] input 0 input[1] input 1 0 {
				tSum += 3;
			} tSum += 3 tSum 3 if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			} input[0].compareTo(input[1]) == 0 input[0].compareTo(input[1]) input[0].compareTo input[0] input 0 input[1] input 1 0 {
				tSum += 1;
				hSum += 1;
			} tSum += 1 tSum 1 hSum += 1 hSum 1 {
				hSum += 3;
			} hSum += 3 hSum 3 System.out.println(tSum + " " + hSum) System.out.println System.out System System.out tSum + " " + hSum tSum + " " + hSum tSum " " hSum String[] args args public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	}
} public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int tSum = 0;
		int hSum = 0;
		int n = Integer.parseInt(br.readLine());

		for (int i = 0; i < n; i++) {
			String[] input = br.readLine().split(" ");
			if (input[0].compareTo(input[1]) > 0) {
				tSum += 3;
			} else if (input[0].compareTo(input[1]) == 0) {
				tSum += 1;
				hSum += 1;
			} else {
				hSum += 3;
			}
		}
		System.out.println(tSum + " " + hSum);
	}
}