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 n = Integer.parseInt(br.readLine());
		int taroscore = 0;
		int hanakoscore = 0;
		for (int i = 0; i < n; i++) {
			String[] str2 = br.readLine().split(" ");

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

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		}
		System.out.println(taroscore + " " + hanakoscore);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int taroscore = 0;
		int hanakoscore = 0;
		for (int i = 0; i < n; i++) {
			String[] str2 = br.readLine().split(" ");

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		}
		System.out.println(taroscore + " " + hanakoscore);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int taroscore = 0;
		int hanakoscore = 0;
		for (int i = 0; i < n; i++) {
			String[] str2 = br.readLine().split(" ");

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		}
		System.out.println(taroscore + " " + hanakoscore);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int taroscore = 0; taroscore 0 int hanakoscore = 0; hanakoscore 0 for (int i = 0; i < n; i++) {
			String[] str2 = br.readLine().split(" ");

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] str2 = br.readLine().split(" ");

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		} {
			String[] str2 = br.readLine().split(" ");

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		} String[] str2 = br.readLine().split(" "); str2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			} str2[0].compareTo(str2[1]) > 0 str2[0].compareTo(str2[1]) str2[0].compareTo str2[0] str2 0 str2[1] str2 1 0 {
				taroscore += 3;
			} taroscore += 3 taroscore 3 if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			} str2[0].compareTo(str2[1]) < 0 str2[0].compareTo(str2[1]) str2[0].compareTo str2[0] str2 0 str2[1] str2 1 0 {
				hanakoscore += 3;
			} hanakoscore += 3 hanakoscore 3 {
				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 String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int taroscore = 0;
		int hanakoscore = 0;
		for (int i = 0; i < n; i++) {
			String[] str2 = br.readLine().split(" ");

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		}
		System.out.println(taroscore + " " + hanakoscore);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int taroscore = 0;
		int hanakoscore = 0;
		for (int i = 0; i < n; i++) {
			String[] str2 = br.readLine().split(" ");

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

			if (str2[0].compareTo(str2[1]) > 0) {
				taroscore += 3;
			} else if (str2[0].compareTo(str2[1]) < 0) {
				hanakoscore += 3;
			} else {
				taroscore += 1;
				hanakoscore += 1;
			}
		}
		System.out.println(taroscore + " " + hanakoscore);
	}
}