import java.util.Scanner;

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

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