import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int i, n;
        n = sc.nextInt();
        int L = 0, R = 0;
        for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

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

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
        System.out.println(R + " " + L);
        sc.close();
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int i, n;
        n = sc.nextInt();
        int L = 0, R = 0;
        for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
        System.out.println(R + " " + L);
        sc.close();
    } main {
		Scanner sc = new Scanner(System.in);
		int i, n;
        n = sc.nextInt();
        int L = 0, R = 0;
        for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
        System.out.println(R + " " + L);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int i i n; n n = sc.nextInt() n sc.nextInt() sc.nextInt sc int L = 0 L 0 R = 0; R 0 for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        } i = 0; i = 0 i 0 i < n i n i++ i++ i {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        } {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        } String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            } a.compareTo(b) == 0 a.compareTo(b) a.compareTo a b 0 {
                L++;
                R++;
            } L++ L R++ R if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            } a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
                L += 3;
            } L += 3 L 3 {
                R += 3;
            } R += 3 R 3 System.out.println(R + " " + L) System.out.println System.out System System.out R + " " + L R + " " + L R " " L sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int i, n;
        n = sc.nextInt();
        int L = 0, R = 0;
        for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
        System.out.println(R + " " + L);
        sc.close();
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int i, n;
        n = sc.nextInt();
        int L = 0, R = 0;
        for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
        System.out.println(R + " " + L);
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int i, n;
        n = sc.nextInt();
        int L = 0, R = 0;
        for( i = 0; i < n; i++) {
            String a = sc.next();
            String b = sc.next();

            if(a.compareTo(b) == 0) {
                L++;
                R++;
            }
            else if(a.compareTo(b) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
        System.out.println(R + " " + L);
        sc.close();
    }
}

