import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taro=0 taro 0 hanako=0; hanako 0 for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		} {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		} String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			} a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
				taro += 3;
			} taro += 3 taro 3 if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			} a.compareTo(b) > 0 a.compareTo(b) a.compareTo a b 0 {
				hanako += 3;
			} hanako += 3 hanako 3 {
				taro += 1;
				hanako += 1;
			} taro += 1 taro 1 hanako += 1 hanako 1 System.out.println(hanako + " " + taro) System.out.println System.out System System.out hanako + " " + taro hanako + " " + taro hanako " " taro String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int taro=0, hanako=0;
		for (int i = 0; i < n; i++) {
			String a = sc.next();
			String b = sc.next();
			if (a.compareTo(b) < 0) {
				taro += 3;
			} else if (a.compareTo(b) > 0) {
				hanako += 3;
			} else {
				taro += 1;
				hanako += 1;
			}
		}
		System.out.println(hanako + " " + taro);
	}
}

