import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    }
    public static int isWin(String a,String b){
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    }
    public static int isWin(String a,String b){
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    }
} Main public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    } main {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    } Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) int n=scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int taro=0; taro 0 int hanako=0; hanako 0 for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        } {
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        } String a=scanner.next(); a scanner.next() scanner.next scanner String b=scanner.next(); b scanner.next() scanner.next scanner switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            } isWin(a,b) isWin a b case 0: 0 case 0: taro++ taro hanako++ hanako break; case 1: 1 case 1: taro += 3 taro 3 break; case 2: 2 case 2: hanako += 3 hanako 3 break; System.out.println(taro+" "+hanako) System.out.println System.out System System.out taro+" "+hanako taro+" "+hanako taro " " hanako String[] args args public static int isWin(String a,String b){
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    } isWin {
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    } int len=Math.min(a.length(),b.length()); len Math.min(a.length(),b.length()) Math.min Math a.length() a.length a b.length() b.length b String alphabet="abcdefghijklmnopqrstuvwxyz"; alphabet "abcdefghijklmnopqrstuvwxyz" for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        } int i=0; int i=0; i 0 i<len i len i++ i++ i {
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        } {
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        } if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            } alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i)) alphabet.indexOf(a.charAt(i)) alphabet.indexOf alphabet a.charAt(i) a.charAt a i alphabet.indexOf(b.charAt(i)) alphabet.indexOf alphabet b.charAt(i) b.charAt b i {
                return 2;
            } return 2; 2 if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            } alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i)) alphabet.indexOf(a.charAt(i)) alphabet.indexOf alphabet a.charAt(i) a.charAt a i alphabet.indexOf(b.charAt(i)) alphabet.indexOf alphabet b.charAt(i) b.charAt b i {
                return 1;
            } return 1; 1 if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        } a.length()==b.length() a.length() a.length a b.length() b.length b {
            return 0;
        } return 0; 0 if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        } a.length()>b.length() a.length() a.length a b.length() b.length b {
            return 1;
        } return 1; 1 {
            return 2;
        } return 2; 2 String a a String b b public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    }
    public static int isWin(String a,String b){
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    }
} public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    }
    public static int isWin(String a,String b){
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int taro=0;
        int hanako=0;
        for(int i=0; i<n ;i++){
            String a=scanner.next();
            String b=scanner.next();
            switch(isWin(a,b)) {
                case 0:
                    taro++;
                    hanako++;
                    break;
                case 1:
                    taro += 3;
                    break;
                case 2:
                    hanako += 3;
                    break;
            }
        }
        System.out.println(taro+" "+hanako);
    }
    public static int isWin(String a,String b){
        int len=Math.min(a.length(),b.length());
        String alphabet="abcdefghijklmnopqrstuvwxyz";
        for(int i=0;i<len;i++){
            if(alphabet.indexOf(a.charAt(i))<alphabet.indexOf(b.charAt(i))){
                return 2;
            }else if(alphabet.indexOf(a.charAt(i))>alphabet.indexOf(b.charAt(i))){
                return 1;
            }
        }
        if(a.length()==b.length()){
            return 0;
        }else if(a.length()>b.length()){
            return 1;
        }else{
            return 2;
        }
    }
}

