
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 count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

		for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		}
		System.out.println(pointOfTaro + " " + pointOfHanako);
	}
} 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 count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

		for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		}
		System.out.println(pointOfTaro + " " + pointOfHanako);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

		for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		}
		System.out.println(pointOfTaro + " " + pointOfHanako);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int count = Integer.parseInt(br.readLine()); count Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int pointOfTaro = 0; pointOfTaro 0 int pointOfHanako = 0; pointOfHanako 0 for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		} {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		} String[] strs = br.readLine().split(" "); strs br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			} 0 < strs[0].compareTo(strs[1]) 0 strs[0].compareTo(strs[1]) strs[0].compareTo strs[0] strs 0 strs[1] strs 1 {
				pointOfTaro = pointOfTaro + 3;
			} pointOfTaro = pointOfTaro + 3 pointOfTaro pointOfTaro + 3 pointOfTaro 3 if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			} strs[0].compareTo(strs[1]) < 0 strs[0].compareTo(strs[1]) strs[0].compareTo strs[0] strs 0 strs[1] strs 1 0 {
				pointOfHanako = pointOfHanako + 3;
			} pointOfHanako = pointOfHanako + 3 pointOfHanako pointOfHanako + 3 pointOfHanako 3 {
				pointOfTaro++;
				pointOfHanako++;
			} pointOfTaro++ pointOfTaro pointOfHanako++ pointOfHanako System.out.println(pointOfTaro + " " + pointOfHanako) System.out.println System.out System System.out pointOfTaro + " " + pointOfHanako pointOfTaro + " " + pointOfHanako pointOfTaro " " pointOfHanako String[] args args public class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

		for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		}
		System.out.println(pointOfTaro + " " + pointOfHanako);
	}
} public class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

		for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		}
		System.out.println(pointOfTaro + " " + pointOfHanako);
	}
} 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 count = Integer.parseInt(br.readLine());
		int pointOfTaro = 0;
		int pointOfHanako = 0;

		for (int i = 0; i < count; i++) {
			String[] strs = br.readLine().split(" ");
			if (0 < strs[0].compareTo(strs[1])) {
				pointOfTaro = pointOfTaro + 3;
			} else if (strs[0].compareTo(strs[1]) < 0) {
				pointOfHanako = pointOfHanako + 3;
			} else {
				pointOfTaro++;
				pointOfHanako++;
			}
		}
		System.out.println(pointOfTaro + " " + pointOfHanako);
	}
}