import java.util.Scanner;

/**
 * Card Game
 */
public class Main {
    private static final int WIN = 3;
    private static final int DRAW = 1;

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

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    private static final int WIN = 3;
    private static final int DRAW = 1;

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

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    }
} Main private static final int WIN = 3; WIN 3 private static final int DRAW = 1; DRAW 1 public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    } main {
        Scanner scan = new Scanner(System.in);

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int count[] = new int[2]; count new int[2] 2 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        } {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        } int point = scan.next().compareToIgnoreCase(scan.next()); point scan.next().compareToIgnoreCase(scan.next()) scan.next().compareToIgnoreCase scan.next() scan.next scan scan.next() scan.next scan if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            } point > 0 point 0 {
                count[0] += WIN;
            } count[0] += WIN count[0] count 0 WIN if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            } point < 0 point 0 {
                count[1] += WIN;
            } count[1] += WIN count[1] count 1 WIN {
                count[0] += DRAW;
                count[1] += DRAW;
            } count[0] += DRAW count[0] count 0 DRAW count[1] += DRAW count[1] count 1 DRAW System.out.println(count[0] + " " + count[1]) System.out.println System.out System System.out count[0] + " " + count[1] count[0] + " " + count[1] count[0] count 0 " " count[1] count 1 String[] args args public class Main {
    private static final int WIN = 3;
    private static final int DRAW = 1;

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

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    }
} public class Main {
    private static final int WIN = 3;
    private static final int DRAW = 1;

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

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    }
} Main
import java.util.Scanner;

/**
 * Card Game
 */
public class Main {
    private static final int WIN = 3;
    private static final int DRAW = 1;

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

        int count[] = new int[2];   // 太郎[0]と花子[1]のポイントカウンター
        int n = scan.nextInt();
        for (int i = 0; i < n; i++) {
            int point = scan.next().compareToIgnoreCase(scan.next());
            if (point > 0) {
                count[0] += WIN;
            } else if (point < 0){
                count[1] += WIN;
            } else {
                count[0] += DRAW;
                count[1] += DRAW;
            }
        }
        System.out.println(count[0] + " " + count[1]);
    }
}