import java.util.Scanner;

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

	public static void main(String[] args) {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	}

} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	} main {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int pt_t = 0; pt_t 0 int pt_h = 0; pt_h 0 for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		} {
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		} String wd_t = sc.next(); wd_t sc.next() sc.next sc String wd_h = sc.next(); wd_h sc.next() sc.next sc if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			} wd_t.compareTo(wd_h) > 0 wd_t.compareTo(wd_h) wd_t.compareTo wd_t wd_h 0 {
				pt_t += 3;
			} pt_t += 3 pt_t 3 if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			} wd_t.compareTo(wd_h) < 0 wd_t.compareTo(wd_h) wd_t.compareTo wd_t wd_h 0 {
				pt_h += 3;
			} pt_h += 3 pt_h 3 {
				pt_t++;
				pt_h++;
			} pt_t++ pt_t pt_h++ pt_h System.out.println(pt_t + " " + pt_h) System.out.println System.out System System.out pt_t + " " + pt_h pt_t + " " + pt_h pt_t " " pt_h String[] args args public class Main {
	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	}

} public class Main {
	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	}

} Main
import java.util.Scanner;

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

	public static void main(String[] args) {
		int n = sc.nextInt();
		int pt_t = 0;
		int pt_h = 0;

		for(int i=1; i<=n; i++){
			String wd_t = sc.next();
			String wd_h = sc.next();

			if(wd_t.compareTo(wd_h) > 0) {
				pt_t += 3;
			} else if(wd_t.compareTo(wd_h) < 0) {
				pt_h += 3;
			} else {
				pt_t++;
				pt_h++;
			}
		}

		System.out.println(pt_t + " " + pt_h);
	}

}