import java.util.Scanner;

class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int y1=0;
		int y2=0;
		int n=sc.nextInt();
		
		for(int i=0;i<n;i++) {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		}
		
	    System.out.println(y1+" "+y2);

}
} import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int y1=0;
		int y2=0;
		int n=sc.nextInt();
		
		for(int i=0;i<n;i++) {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		}
		
	    System.out.println(y1+" "+y2);

}
} Main public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int y1=0;
		int y2=0;
		int n=sc.nextInt();
		
		for(int i=0;i<n;i++) {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		}
		
	    System.out.println(y1+" "+y2);

} main {

		Scanner sc =new Scanner(System.in);

		int y1=0;
		int y2=0;
		int n=sc.nextInt();
		
		for(int i=0;i<n;i++) {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		}
		
	    System.out.println(y1+" "+y2);

} Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int y1=0; y1 0 int y2=0; y2 0 int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++) {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		} {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		} String x1 =sc.next(); x1 sc.next() sc.next sc String x2 =sc.next(); x2 sc.next() sc.next sc if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		} x1.compareTo(x2)==0 x1.compareTo(x2) x1.compareTo x1 x2 0 {
			y1++;
			y2++;
		} y1++ y1 y2++ y2 if(x1.compareTo(x2)<0) 
			y2+=3; x1.compareTo(x2)<0 x1.compareTo(x2) x1.compareTo x1 x2 0 y2+=3 y2 3 if(x1.compareTo(x2)>0) 
			y1+=3; x1.compareTo(x2)>0 x1.compareTo(x2) x1.compareTo x1 x2 0 y1+=3 y1 3 System.out.println(y1+" "+y2) System.out.println System.out System System.out y1+" "+y2 y1+" "+y2 y1 " " y2 String[] args args
import java.util.Scanner;

class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int y1=0;
		int y2=0;
		int n=sc.nextInt();
		
		for(int i=0;i<n;i++) {
		
		String x1 =sc.next();
		String x2 =sc.next();
		
		if(x1.compareTo(x2)==0) {
			y1++;
			y2++;
		}
		
		if(x1.compareTo(x2)<0) 
			y2+=3;
		
		if(x1.compareTo(x2)>0) 
			y1+=3;
		
		}
		
	    System.out.println(y1+" "+y2);

}
}
