import java.util.Arrays;
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int tp=0; tp 0 int hp=0; hp 0 for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		} {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		} String[] array = new String[2]; array new String[2] 2 String taro=sc.next(); taro sc.next() sc.next sc String hanako=sc.next(); hanako sc.next() sc.next sc array[0]=taro array[0] array 0 taro array[1]=hanako array[1] array 1 hanako Arrays.sort(array) Arrays.sort Arrays array if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			} array[0].equals(array[1]) array[0].equals array[0] array 0 array[1] array 1 {
				tp+=1;
				hp+=1;
			} tp+=1 tp 1 hp+=1 hp 1 if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			} array[1].equals(taro) array[1].equals array[1] array 1 taro {
				tp+=3;
			} tp+=3 tp 3 if(array[1].equals(hanako)) {
				hp+=3;
			} array[1].equals(hanako) array[1].equals array[1] array 1 hanako {
				hp+=3;
			} hp+=3 hp 3 System.out.printf("%d %d", tp,hp) System.out.printf System.out System System.out "%d %d" tp hp System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int tp=0;
		int hp=0;

		for(int i=0; i<n;i++) {
			String[] array = new String[2];
			String taro=sc.next();
			String hanako=sc.next();
			array[0]=taro;
			array[1]=hanako;

			Arrays.sort(array);
			if(array[0].equals(array[1])) {
				tp+=1;
				hp+=1;
			}else if(array[1].equals(taro)) {
				tp+=3;
			}else if(array[1].equals(hanako)) {
				hp+=3;
			}
		}
		System.out.printf("%d %d", tp,hp);
		System.out.println();
	}
}
