
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	}
} Main public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	} main {
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int TAROpoint =0; TAROpoint 0 int HANAKOpoint =0; HANAKOpoint 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		} {
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		} String TAROcard = sc.next(); TAROcard sc.next() sc.next sc String HANAKOcard = sc.next(); HANAKOcard sc.next() sc.next sc if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			} HANAKOcard.compareTo(TAROcard) < 0 HANAKOcard.compareTo(TAROcard) HANAKOcard.compareTo HANAKOcard TAROcard 0 {
				//??????????????????
				TAROpoint+= 3;
			} TAROpoint+= 3 TAROpoint 3 if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			} HANAKOcard.compareTo(TAROcard)==0 HANAKOcard.compareTo(TAROcard) HANAKOcard.compareTo HANAKOcard TAROcard 0 {
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			} TAROpoint++ TAROpoint HANAKOpoint++ HANAKOpoint {
				//??±???????????????
				HANAKOpoint+=3;
			} HANAKOpoint+=3 HANAKOpoint 3 System.out.println( TAROpoint +" "+ HANAKOpoint) System.out.println System.out System System.out TAROpoint +" "+ HANAKOpoint TAROpoint +" "+ HANAKOpoint TAROpoint " " HANAKOpoint String[] args args public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	}
} public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int TAROpoint =0;
		int HANAKOpoint =0;
		//n?????????
		int n = sc.nextInt();
		for(int i=0; i<n; i++){
			//??????????????????
			String TAROcard = sc.next();
			//??±???????????????
			String HANAKOcard = sc.next();
			//?????????????????????
			if(HANAKOcard.compareTo(TAROcard) < 0){
				//??????????????????
				TAROpoint+= 3;
			}else if(HANAKOcard.compareTo(TAROcard)==0){
				//?????????1????????????
				TAROpoint++;
				HANAKOpoint++;
			}else{
				//??±???????????????
				HANAKOpoint+=3;
			}
		}
		//??¨??? ?????????????????? ??±???????????????
		System.out.println( TAROpoint +" "+ HANAKOpoint);
		
	}
}