import java.util.Scanner;

public class Main {

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

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

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[] b = new int[2];
        for(int i=0; i < a; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if(s1.compareTo(s2) > 0) {
                b[0] += 3;
            }
            else if(s1.compareTo(s2) < 0) {
                b[1] += 3;
            }
            else {
                b[0]++;
                b[1]++;
            }
        }
        System.out.println(b[0] + " " + b[1]);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[] b = new int[2];
        for(int i=0; i < a; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if(s1.compareTo(s2) > 0) {
                b[0] += 3;
            }
            else if(s1.compareTo(s2) < 0) {
                b[1] += 3;
            }
            else {
                b[0]++;
                b[1]++;
            }
        }
        System.out.println(b[0] + " " + b[1]);
    }
}
