import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        } sc.hasNext() sc.hasNext sc {
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        } int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int taro = 0 taro 0 hanako = 0; hanako 0 for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            } int i=0; int i=0; i 0 i<num i num i++ i++ i {
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            } {
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            } 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) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                } a.compareTo(b) > 0 a.compareTo(b) a.compareTo a b 0 {
                    taro += 3;
                } taro += 3 taro 3 if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                } a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
                    hanako += 3;
                } hanako += 3 hanako 3 {
                    taro += 1;
                    hanako += 1;
                } taro += 1 taro 1 hanako += 1 hanako 1 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int taro = 0, hanako = 0;
            for (int i=0; i<num; i++){
                String a = sc.next();
                String b = sc.next();
                if (a.compareTo(b) > 0) {
                    taro += 3;
                } else if (a.compareTo(b) < 0) {
                    hanako += 3;
                } else {
                    taro += 1;
                    hanako += 1;
                }
            }
            System.out.println(taro + " " + hanako);
        }
    }
} Main
import java.util.Scanner;

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

