import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    } main {
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num=sc.nextInt(); num sc.nextInt() sc.nextInt sc String comp[][] = new String[2][num]; comp new String[2][num] 2 num int taro=0; taro 0 int hanako=0; hanako 0 for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        } int i=0; int i=0; i 0 i< num i num i++ i++ i {
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        } {
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        } comp[0][i]= sc.next() comp[0][i] comp[0] comp 0 i sc.next() sc.next sc comp[1][i]= sc.next() comp[1][i] comp[1] comp 1 i sc.next() sc.next sc sc.close() sc.close sc for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        } int i=0; int i=0; i 0 i< num i num i++ i++ i {
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        } {
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        } int ans = comp[0][i].compareTo(comp[1][i]); ans comp[0][i].compareTo(comp[1][i]) comp[0][i].compareTo comp[0][i] comp[0] comp 0 i comp[1][i] comp[1] comp 1 i if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	} ans == 0 ans 0 {
        		taro += 1;
        		hanako += 1;
        	} taro += 1 taro 1 hanako += 1 hanako 1 if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	} ans < 0 ans 0 {
        		hanako += 3;
        	} hanako += 3 hanako 3 {
        		taro += 3;
        	} taro += 3 taro 3 System.out.printf("%d %d%n", taro, hanako) System.out.printf System.out System System.out "%d %d%n" taro hanako String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        String comp[][] = new String[2][num];
        int taro=0;
        int hanako=0;

        for(int i=0; i< num; i++){
        	comp[0][i]= sc.next();
        	comp[1][i]= sc.next();
        }
        sc.close();
        for(int i=0; i< num; i++){
        	int ans = comp[0][i].compareTo(comp[1][i]);
        	if (ans == 0) {
        		taro += 1;
        		hanako += 1;
        	} else if (ans < 0) {
        		hanako += 3;
        	} else {
        		taro += 3;
        	}
        }
        System.out.printf("%d %d%n", taro, hanako);
    }
}
