import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        int n, point1 = 0, point2 = 0;
        String card1, card2;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        }
        System.out.println(point1 + " " + point2);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        int n, point1 = 0, point2 = 0;
        String card1, card2;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        }
        System.out.println(point1 + " " + point2);
    }
} Main public static void main(String[] args) {
        int n, point1 = 0, point2 = 0;
        String card1, card2;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        }
        System.out.println(point1 + " " + point2);
    } main {
        int n, point1 = 0, point2 = 0;
        String card1, card2;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        }
        System.out.println(point1 + " " + point2);
    } int n n point1 = 0 point1 0 point2 = 0; point2 0 String card1 card1 card2; card2 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        } {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        } card1 = sc.next() card1 sc.next() sc.next sc card2 = sc.next() card2 sc.next() sc.next sc if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            } card2.compareTo(card1) < 0 card2.compareTo(card1) card2.compareTo card2 card1 0 {
                point1 += 3;
            } point1 += 3 point1 3 if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            } card1.equals(card2) card1.equals card1 card2 {
                point1++;
                point2++;
            } point1++ point1 point2++ point2 {
                point2 +=3;
            } point2 +=3 point2 3 System.out.println(point1 + " " + point2) System.out.println System.out System System.out point1 + " " + point2 point1 + " " + point2 point1 " " point2 String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        int n, point1 = 0, point2 = 0;
        String card1, card2;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
            card1 = sc.next();
            card2 = sc.next();
            if (card2.compareTo(card1) < 0) {
                point1 += 3;
            } else if (card1.equals(card2)) {
                point1++;
                point2++;
            } else {
                point2 +=3;
            }
        }
        System.out.println(point1 + " " + point2);
    }
}
