
import java.util.Scanner;

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

        for (int i = 0; i < a; i++) {
            String b = sc.next();
            String c = sc.next();
            if (b.compareTo(c) > 0)
                sum1 += 3;
            else if (b.compareTo(c) < 0)
                sum2 += 3;
            else {
                sum1 += 1;
                sum2 += 1;
            }
        }
        System.out.println(sum1 + " " + sum2);
    }
}
 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 sum1 = 0;
        int sum2 = 0;

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

        for (int i = 0; i < a; i++) {
            String b = sc.next();
            String c = sc.next();
            if (b.compareTo(c) > 0)
                sum1 += 3;
            else if (b.compareTo(c) < 0)
                sum2 += 3;
            else {
                sum1 += 1;
                sum2 += 1;
            }
        }
        System.out.println(sum1 + " " + sum2);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int sum1 = 0;
        int sum2 = 0;

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

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

        for (int i = 0; i < a; i++) {
            String b = sc.next();
            String c = sc.next();
            if (b.compareTo(c) > 0)
                sum1 += 3;
            else if (b.compareTo(c) < 0)
                sum2 += 3;
            else {
                sum1 += 1;
                sum2 += 1;
            }
        }
        System.out.println(sum1 + " " + sum2);
    }
} 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 sum1 = 0;
        int sum2 = 0;

        for (int i = 0; i < a; i++) {
            String b = sc.next();
            String c = sc.next();
            if (b.compareTo(c) > 0)
                sum1 += 3;
            else if (b.compareTo(c) < 0)
                sum2 += 3;
            else {
                sum1 += 1;
                sum2 += 1;
            }
        }
        System.out.println(sum1 + " " + sum2);
    }
}

