import java.util.Scanner;

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

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    }

    /**
     *
     * @param str1
     * @param str2
     * @return str1 > str2 -> 1, str1 == str2 -> 0, str1 < str2 -> -1
     */
    public static int compareTo(String str1, String str2){
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int taro = 0;
        int hanako = 0;

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    }

    /**
     *
     * @param str1
     * @param str2
     * @return str1 > str2 -> 1, str1 == str2 -> 0, str1 < str2 -> -1
     */
    public static int compareTo(String str1, String str2){
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int taro = 0;
        int hanako = 0;

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int taro = 0;
        int hanako = 0;

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taro = 0; taro 0 int hanako = 0; hanako 0 for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        } {
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        } int ret = compareTo(sc.next(), sc.next()); ret compareTo(sc.next(), sc.next()) compareTo sc.next() sc.next sc sc.next() sc.next sc if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            } ret > 0 ret 0 taro += 3 taro 3 if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            } ret < 0 ret 0 hanako += 3 hanako 3 {
                taro += 1;
                hanako += 1;
            } taro += 1 taro 1 hanako += 1 hanako 1 System.out.println(String.format("%d %d", taro, hanako)) System.out.println System.out System System.out String.format("%d %d", taro, hanako) String.format String "%d %d" taro hanako String[] args args /**
     *
     * @param str1
     * @param str2
     * @return str1 > str2 -> 1, str1 == str2 -> 0, str1 < str2 -> -1
     */
    public static int compareTo(String str1, String str2){
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    } compareTo {
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    } int length1 = str1.length(); length1 str1.length() str1.length str1 int length2 = str2.length(); length2 str2.length() str2.length str2 if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        } length1 > length2 length1 length2 {
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        } for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } int i = 0; int i = 0; i 0 i < length2 i length2 i++ i++ i {
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } {
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1; str1.charAt(i) > str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return 1; 1 if(str1.charAt(i) < str2.charAt(i)) return -1; str1.charAt(i) < str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return -1; -1 1 return 1; 1 if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        } length1 < length2 length1 length2 {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        } for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } int i = 0; int i = 0; i 0 i < length1 i length1 i++ i++ i {
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } {
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1; str1.charAt(i) > str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return 1; 1 if(str1.charAt(i) < str2.charAt(i)) return -1; str1.charAt(i) < str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return -1; -1 1 return -1; -1 1 {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        } for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } int i = 0; int i = 0; i 0 i < length1 i length1 i++ i++ i {
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } {
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            } if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1; str1.charAt(i) > str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return 1; 1 if(str1.charAt(i) < str2.charAt(i)) return -1; str1.charAt(i) < str2.charAt(i) str1.charAt(i) str1.charAt str1 i str2.charAt(i) str2.charAt str2 i return -1; -1 1 return 0; 0 String str1 str1 String str2 str2 public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int taro = 0;
        int hanako = 0;

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    }

    /**
     *
     * @param str1
     * @param str2
     * @return str1 > str2 -> 1, str1 == str2 -> 0, str1 < str2 -> -1
     */
    public static int compareTo(String str1, String str2){
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int taro = 0;
        int hanako = 0;

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    }

    /**
     *
     * @param str1
     * @param str2
     * @return str1 > str2 -> 1, str1 == str2 -> 0, str1 < str2 -> -1
     */
    public static int compareTo(String str1, String str2){
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    }
} Main
import java.util.Scanner;

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

        for(int i = 0; i < n; i++){
            int ret = compareTo(sc.next(), sc.next());
            if(ret > 0) taro += 3;
            else if(ret < 0) hanako += 3;
            else {
                taro += 1;
                hanako += 1;
            }
        }

        System.out.println(String.format("%d %d", taro, hanako));
    }

    /**
     *
     * @param str1
     * @param str2
     * @return str1 > str2 -> 1, str1 == str2 -> 0, str1 < str2 -> -1
     */
    public static int compareTo(String str1, String str2){
        int length1 = str1.length();
        int length2 = str2.length();
        if(length1 > length2){
            for(int i = 0; i < length2; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 1;
        }
        else if(length1 < length2){
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return -1;
        }
        else {
            for(int i = 0; i < length1; i++){
                if(str1.charAt(i) > str2.charAt(i)) return 1;
                else if(str1.charAt(i) < str2.charAt(i)) return -1;
            }
            return 0;
        }
    }
}

