import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int pointT=0;
	private static int pointH=0;
	private static int size=sc.nextInt();
	public static void main(String[] args){
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	}
	private static void battle(String t,String h){
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int pointT=0;
	private static int pointH=0;
	private static int size=sc.nextInt();
	public static void main(String[] args){
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	}
	private static void battle(String t,String h){
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	}
} Main private static Scanner sc=new Scanner(System.in); sc new Scanner(System.in) private static int pointT=0; pointT 0 private static int pointH=0; pointH 0 private static int size=sc.nextInt(); size sc.nextInt() sc.nextInt sc public static void main(String[] args){
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	} main {
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	} for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		} int i=0; int i=0; i 0 i<size i size i++ i++ i {
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		} {
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		} String wordT=sc.next(); wordT sc.next() sc.next sc String wordH=sc.next(); wordH sc.next() sc.next sc battle(wordT,wordH) battle wordT wordH System.out.println(pointT+" "+pointH) System.out.println System.out System System.out pointT+" "+pointH pointT+" "+pointH pointT " " pointH String[] args args private static void battle(String t,String h){
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	} battle {
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	} if(t.compareTo(h)>0) pointT+=3; t.compareTo(h)>0 t.compareTo(h) t.compareTo t h 0 pointT+=3 pointT 3 if(t.compareTo(h)<0) pointH+=3; t.compareTo(h)<0 t.compareTo(h) t.compareTo t h 0 pointH+=3 pointH 3 if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		} t.compareTo(h)==0 t.compareTo(h) t.compareTo t h 0 {
			pointH++;
			pointT++;
		} pointH++ pointH pointT++ pointT String t t String h h public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int pointT=0;
	private static int pointH=0;
	private static int size=sc.nextInt();
	public static void main(String[] args){
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	}
	private static void battle(String t,String h){
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	}
} public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int pointT=0;
	private static int pointH=0;
	private static int size=sc.nextInt();
	public static void main(String[] args){
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	}
	private static void battle(String t,String h){
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	}
} Main
import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int pointT=0;
	private static int pointH=0;
	private static int size=sc.nextInt();
	public static void main(String[] args){
		for(int i=0;i<size;i++){
			String wordT=sc.next();
			String wordH=sc.next();
			battle(wordT,wordH);
		}
		System.out.println(pointT+" "+pointH);
	}
	private static void battle(String t,String h){
		if(t.compareTo(h)>0) pointT+=3;
		if(t.compareTo(h)<0) pointH+=3;
		if(t.compareTo(h)==0){
			pointH++;
			pointT++;
		}
	}
}