import java.util.Scanner;

public class Main{

	static final Scanner s=new Scanner(System.in);

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

	static final Scanner s=new Scanner(System.in);

	public static void main(String args[]){
		int t=0,h=0;
		String st,sh;
		for(int i=s.nextInt();i>0;i--) {
			st=s.next();
			sh=s.next();
			if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n",t,h);
	}
} Main static final Scanner s=new Scanner(System.in); s new Scanner(System.in) public static void main(String args[]){
		int t=0,h=0;
		String st,sh;
		for(int i=s.nextInt();i>0;i--) {
			st=s.next();
			sh=s.next();
			if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n",t,h);
	} main {
		int t=0,h=0;
		String st,sh;
		for(int i=s.nextInt();i>0;i--) {
			st=s.next();
			sh=s.next();
			if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			}
		}
		System.out.printf("%d %d\n",t,h);
	} int t=0 t 0 h=0; h 0 String st st sh; sh for(int i=s.nextInt();i>0;i--) {
			st=s.next();
			sh=s.next();
			if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			}
		} int i=s.nextInt(); int i=s.nextInt(); i s.nextInt() s.nextInt s i>0 i 0 i-- i-- i {
			st=s.next();
			sh=s.next();
			if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			}
		} {
			st=s.next();
			sh=s.next();
			if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			}
		} st=s.next() st s.next() s.next s sh=s.next() sh s.next() s.next s if(st.compareTo(sh)>0)
				t+=3;
			else if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			} st.compareTo(sh)>0 st.compareTo(sh) st.compareTo st sh 0 t+=3 t 3 if(st.compareTo(sh)<0)
				h+=3;
			else {
				t++;
				h++;
			} st.compareTo(sh)<0 st.compareTo(sh) st.compareTo st sh 0 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{

	static final Scanner s=new Scanner(System.in);

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

	static final Scanner s=new Scanner(System.in);

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

public class Main{

	static final Scanner s=new Scanner(System.in);

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