import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	}
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	} main {
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int pa=0 pa 0 pb=0; pb 0 int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		} {
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		} String A = sc.next(); A sc.next() sc.next sc String B = sc.next(); B sc.next() sc.next sc if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			} A.compareTo(B)>0 A.compareTo(B) A.compareTo A B 0 {
				pa+=3;
			} pa+=3 pa 3 if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			} A.compareTo(B)<0 A.compareTo(B) A.compareTo A B 0 {
				pb+=3;
			} pb+=3 pb 3 {
				pa++;
				pb++;
			} pa++ pa pb++ pb System.out.println(pa+" "+pb) System.out.println System.out System System.out pa+" "+pb pa+" "+pb pa " " pb String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int pa=0,pb=0;
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String A = sc.next();
			String B = sc.next();
			if(A.compareTo(B)>0){
				pa+=3;
			}else if(A.compareTo(B)<0){
				pb+=3;
			}else{
				pa++;
				pb++;
			}
		}
		System.out.println(pa+" "+pb);
	}
}