
import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	}
} Main public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	} main {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan String result1 result1 result2; result2 int sum1 sum1 sum2; sum2 sum1 = 0 sum1 0 sum2 = 0 sum2 0 for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		} int count=0; int count=0; count 0 count<x count x count++ count++ count {
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		} {
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		} result1 = scan.next() result1 scan.next() scan.next scan result2 = scan.next() result2 scan.next() scan.next scan if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			} result1.compareTo(result2) > 0 result1.compareTo(result2) result1.compareTo result1 result2 0 {//result1?????????
				sum1 = sum1 + 3;
			} sum1 = sum1 + 3 sum1 sum1 + 3 sum1 3 if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			} result1.compareTo(result2) == 0 result1.compareTo(result2) result1.compareTo result1 result2 0 {//????????????
				sum1++;
				sum2++;
			} sum1++ sum1 sum2++ sum2 {//result1?????????
				sum2 = sum2 + 3;
			} sum2 = sum2 + 3 sum2 sum2 + 3 sum2 3 System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2)) System.out.println System.out System System.out Integer.toString(sum1) + " " + Integer.toString(sum2) Integer.toString(sum1) + " " + Integer.toString(sum2) Integer.toString(sum1) Integer.toString Integer sum1 " " Integer.toString(sum2) Integer.toString Integer sum2 String args[] args public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	}
} public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	}
} Main

import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();//?????°
		String result1,result2;
		int sum1,sum2;
		sum1 = 0;//?????????
		sum2 = 0;//?????????
		
		//?????°??????????????????
		for(int count=0;count<x;count++){
			result1 = scan.next();
			result2 = scan.next();
			if(result1.compareTo(result2) > 0){//result1?????????
				sum1 = sum1 + 3;
			}else if(result1.compareTo(result2) == 0){//????????????
				sum1++;
				sum2++;
			}else{//result1?????????
				sum2 = sum2 + 3;
			}
		}
		System.out.println(Integer.toString(sum1) + " " + Integer.toString(sum2));
	}
}