import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    } main {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    } int taroP = 0; taroP 0 int hanakoP = 0; hanakoP 0 int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        } num > 0 num 0 {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        } String taroStr = sc.next(); taroStr sc.next() sc.next sc String hanakoStr = sc.next(); hanakoStr sc.next() sc.next sc int result = taroStr.compareTo(hanakoStr); result taroStr.compareTo(hanakoStr) taroStr.compareTo taroStr hanakoStr if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            } result > 0 result 0 {
                taroP = taroP + 3;
            } taroP = taroP + 3 taroP taroP + 3 taroP 3 if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            } result < 0 result 0 {
                hanakoP = hanakoP + 3;
            } hanakoP = hanakoP + 3 hanakoP hanakoP + 3 hanakoP 3 {
                taroP++;
                hanakoP++;
            } taroP++ taroP hanakoP++ hanakoP num-- num System.out.println(taroP + " " + hanakoP) System.out.println System.out System System.out taroP + " " + hanakoP taroP + " " + hanakoP taroP " " hanakoP String[] args args public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    }
} public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    }
} Main
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int taroP = 0;
        int hanakoP = 0;
        int num = sc.nextInt();
        while (num > 0) {
            String taroStr = sc.next();
            String hanakoStr = sc.next();
            int result = taroStr.compareTo(hanakoStr);
            if (result > 0) {
                taroP = taroP + 3;
            } else if (result < 0){
                hanakoP = hanakoP + 3;
            }else {
                taroP++;
                hanakoP++;
            }
            num--;
        }
        System.out.println(taroP + " " + hanakoP);
    }
}

