import java.util.Scanner;

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

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p_a = 0;
        int p_b = 0;
        for(int i=0; i<n; i++){
            String str_a = sc.next();
            String str_b = sc.next();
            if(str_a.compareTo(str_b) > 0) {p_a += 3;}
            else if(str_a.equals(str_b)) {
                p_a++;
                p_b++;
            }
            else {p_b += 3;}
        }
        System.out.println(p_a + " " + p_b);
    }
}
