import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        sc.nextLine();

        int pointA = 0;
        int pointB = 0;

        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        }
        System.out.printf("%d %d\n", pointA, pointB);
        sc.close();
    }
    static int compString(String a, String b){
        if(a.equals(b)){
            return 0;
        }
        
        int len = a.length() < b.length() ? a.length() : b.length();
        for(int i=0;i<len;i++){
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        }

        if(a.length()>b.length()){
            return 1;
        }else{
            return -1;
        }
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        sc.nextLine();

        int pointA = 0;
        int pointB = 0;

        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        }
        System.out.printf("%d %d\n", pointA, pointB);
        sc.close();
    }
    static int compString(String a, String b){
        if(a.equals(b)){
            return 0;
        }
        
        int len = a.length() < b.length() ? a.length() : b.length();
        for(int i=0;i<len;i++){
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        }

        if(a.length()>b.length()){
            return 1;
        }else{
            return -1;
        }
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        sc.nextLine();

        int pointA = 0;
        int pointB = 0;

        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        }
        System.out.printf("%d %d\n", pointA, pointB);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        sc.nextLine();

        int pointA = 0;
        int pointB = 0;

        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        }
        System.out.printf("%d %d\n", pointA, pointB);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc int pointA = 0; pointA 0 int pointB = 0; pointB 0 for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        } {
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        } String strA = sc.next(); strA sc.next() sc.next sc String strB = sc.next(); strB sc.next() sc.next sc sc.nextLine() sc.nextLine sc switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            } compString(strA, strB) compString strA strB case 1: 1 case 1: pointA += 3 pointA 3 break; case -1: -1 1 case -1: pointB +=3 pointB 3 break; case 0: 0 case 0: pointA++ pointA pointB++ pointB break; System.out.printf("%d %d\n", pointA, pointB) System.out.printf System.out System System.out "%d %d\n" pointA pointB sc.close() sc.close sc String args[] args static int compString(String a, String b){
        if(a.equals(b)){
            return 0;
        }
        
        int len = a.length() < b.length() ? a.length() : b.length();
        for(int i=0;i<len;i++){
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        }

        if(a.length()>b.length()){
            return 1;
        }else{
            return -1;
        }
    } compString {
        if(a.equals(b)){
            return 0;
        }
        
        int len = a.length() < b.length() ? a.length() : b.length();
        for(int i=0;i<len;i++){
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        }

        if(a.length()>b.length()){
            return 1;
        }else{
            return -1;
        }
    } if(a.equals(b)){
            return 0;
        } a.equals(b) a.equals a b {
            return 0;
        } return 0; 0 int len = a.length() < b.length() ? a.length() : b.length(); len a.length() < b.length() ? a.length() : b.length() a.length() < b.length() a.length() a.length a b.length() b.length b a.length() a.length a b.length() b.length b for(int i=0;i<len;i++){
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        } int i=0; int i=0; i 0 i<len i len i++ i++ i {
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        } {
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        } if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            } a.charAt(i)>b.charAt(i) a.charAt(i) a.charAt a i b.charAt(i) b.charAt b i {
                return 1;
            } return 1; 1 if(a.charAt(i)<b.charAt(i)){
                return -1;
            } a.charAt(i)<b.charAt(i) a.charAt(i) a.charAt a i b.charAt(i) b.charAt b i {
                return -1;
            } return -1; -1 1 if(a.length()>b.length()){
            return 1;
        }else{
            return -1;
        } a.length()>b.length() a.length() a.length a b.length() b.length b {
            return 1;
        } return 1; 1 {
            return -1;
        } return -1; -1 1 String a a String b b
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        sc.nextLine();

        int pointA = 0;
        int pointB = 0;

        for(int i=0;i<n;i++){
            String strA = sc.next();
            String strB = sc.next();
            sc.nextLine();

            switch (compString(strA, strB)){
                case 1:
                    pointA += 3;
                    break;
                case -1:
                    pointB +=3;
                    break;
                case 0:
                    pointA++;
                    pointB++;
                    break;
            }
        }
        System.out.printf("%d %d\n", pointA, pointB);
        sc.close();
    }
    static int compString(String a, String b){
        if(a.equals(b)){
            return 0;
        }
        
        int len = a.length() < b.length() ? a.length() : b.length();
        for(int i=0;i<len;i++){
            if(a.charAt(i)>b.charAt(i)){
                return 1;
            }else if(a.charAt(i)<b.charAt(i)){
                return -1;
            }
        }

        if(a.length()>b.length()){
            return 1;
        }else{
            return -1;
        }
    }
}
