import java.util.HashMap;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.Collections;
import java.math.BigDecimal;
import java.util.LinkedList;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    }
} import java.util.HashMap; HashMap java.util import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util import java.util.regex.Pattern; Pattern java.util.regex import java.util.Collections; Collections java.util import java.math.BigDecimal; BigDecimal java.math import java.util.LinkedList; LinkedList java.util public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    }
} Main public static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    } main {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int pt = 0; pt 0 int ph = 0; ph 0 for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        } {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        } String t = sc.next(); t sc.next() sc.next sc String h = sc.next(); h sc.next() sc.next sc int res = t.compareTo(h); res t.compareTo(h) t.compareTo t h if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            } res > 0 res 0 {
                pt += 3;
            } pt += 3 pt 3 if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            } res < 0 res 0 {
                ph += 3;
            } ph += 3 ph 3 {
                pt++;
                ph++;
            } pt++ pt ph++ ph System.out.println(pt + " " + ph) System.out.println System.out System System.out pt + " " + ph pt + " " + ph pt " " ph String[] args args public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    }
} public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    }
} Main
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.Collections;
import java.math.BigDecimal;
import java.util.LinkedList;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int pt = 0;
        int ph = 0;
        for (int i = 0; i < n; i++) {
            String t = sc.next();
            String h = sc.next();
            int res = t.compareTo(h);
            if (res > 0) {
                pt += 3;
            } else if (res < 0) {
                ph += 3;
            } else {
                pt++;
                ph++;
            }
        }
        
        System.out.println(pt + " " + ph);
    }
}