import java.util.Scanner;

public class Main {
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    }
} 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 h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    }
} Main public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int h = 0; h 0 int t = 0; t 0 for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        } {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        } String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            } a.compareTo(b) > 0 a.compareTo(b) a.compareTo a b 0 {
                t+=3;
            } t+=3 t 3 if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            } a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
                h+=3;
            } h+=3 h 3 {
                t++;
                h++;
            } t++ t h++ h System.out.printf("%d %d\n", t , h) System.out.printf System.out System System.out "%d %d\n" t h String[]args args public class Main {
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    }
} public class Main {
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    }
} 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 h = 0; int t = 0;
        for (int i = 0; i < n; i++) {
            String a = sc.next(); String b = sc.next();
            if (a.compareTo(b) > 0) {
                t+=3;
            }else if(a.compareTo(b) < 0){
                h+=3;
            }else{
                t++;
                h++;
            }
            
        }
        System.out.printf("%d %d\n", t , h);
    }
}
