import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	}
} import java.util.*; util.* java public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	}
} Main private static final Scanner scan = new Scanner(System.in); scan new Scanner(System.in) public static void main(String[] args){
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	} main {
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	} int t = 0; t 0 int h = 0; h 0 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		} {
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		} String taro = scan.next(); taro scan.next() scan.next scan String hana = scan.next(); hana scan.next() scan.next scan if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			} taro.compareTo(hana) > 0 taro.compareTo(hana) taro.compareTo taro hana 0 {
				t += 3;
			} t += 3 t 3 if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			} taro.compareTo(hana) < 0 taro.compareTo(hana) taro.compareTo taro hana 0 {
				h += 3;
			} h += 3 h 3 {
				t++;
				h++;
			} t++ t h++ h System.out.printf("%d %d\n", t, h) System.out.printf System.out System System.out "%d %d\n" t h String[] args args public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	}
} public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	}
} Main
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int t = 0;
		int h = 0;
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hana = scan.next();
			if(taro.compareTo(hana) > 0){
				t += 3;
			} else if(taro.compareTo(hana) < 0){
				h += 3;
			} else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n", t, h);
	}
}