import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    }
} import java.util.*; util.* java public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    } main {
        Main main = new Main();
        main.solv();
    } Main main = new Main(); main new Main() main.solv() main.solv main String[] args args private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    } solv {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int n = input.nextInt(); n input.nextInt() input.nextInt input int[] score = new int[2]; score new int[2] 2 while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        } n-- > 0 n-- n 0 {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        } String a = input.next(); a input.next() input.next input String b = input.next(); b input.next() input.next input int cmp = a.compareTo(b); cmp a.compareTo(b) a.compareTo a b if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;} 0 < cmp 0 cmp score[0] += 3 score[0] score 0 3 if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;} cmp < 0 cmp 0 score[1] += 3 score[1] score 1 3 {score[0]++; score[1]++;} score[0]++ score[0] score 0 score[1]++ score[1] score 1 System.out.println(String.format("%d %d", score[0], score[1])) System.out.println System.out System System.out String.format("%d %d", score[0], score[1]) String.format String "%d %d" score[0] score 0 score[1] score 1 public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    }
} public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    }
} Main
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] score = new int[2];
        while (n-- > 0) {
            String a = input.next();
            String b = input.next();
            int cmp = a.compareTo(b);
            if (0 < cmp) score[0] += 3;
            else if (cmp < 0) score[1] += 3;
            else {score[0]++; score[1]++;}
        }
        System.out.println(String.format("%d %d", score[0], score[1]));
    }
}