import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	}

}
 import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	}

} Main public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	} main {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) PrintWriter out=new PrintWriter(System.out); out new PrintWriter(System.out) int n=in.nextInt() n in.nextInt() in.nextInt in taro=0 taro 0 hanako=0; hanako 0 for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		} {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		} String str1=in.next() str1 in.next() in.next in str2=in.next(); str2 in.next() in.next in if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			} str1.compareTo(str2)>0 str1.compareTo(str2) str1.compareTo str1 str2 0 taro+=3 taro 3 if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			} str1.compareTo(str2)<0 str1.compareTo(str2) str1.compareTo str1 str2 0 hanako+=3 hanako 3 {
				taro++; hanako++;
			} taro++ taro hanako++ hanako out.println(taro+" "+hanako) out.println out taro+" "+hanako taro+" "+hanako taro " " hanako out.flush() out.flush out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	}

} Main
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String str1=in.next(),str2=in.next();
			if(str1.compareTo(str2)>0)taro+=3;
			else if(str1.compareTo(str2)<0)hanako+=3;
			else {
				taro++; hanako++;
			}
		}
		out.println(taro+" "+hanako);
		out.flush();
	}

}

