import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(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 t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int t = 0 t 0 h = 0; h 0 int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        } int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        } {
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        } String str1 = sc.next(); str1 sc.next() sc.next sc String str2 = sc.next(); str2 sc.next() sc.next sc if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            } str1.compareTo(str2)<0 str1.compareTo(str2) str1.compareTo str1 str2 0 {
                h+=3;
            } h+=3 h 3 if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            } str1.compareTo(str2)==0 str1.compareTo(str2) str1.compareTo str1 str2 0 {
                t++;
                h++;
            } t++ t h++ h {
                t+=3;
            } t+=3 t 3 System.out.println(t + " " + h) System.out.println System.out System System.out t + " " + h t + " " + h t " " h String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    }
}
