import java.util.Scanner;

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i, taro = 0, hanako = 0;
        String tc, hc;
        
        n = sc.nextInt();
        
        for(i = 0; i < n; i++) {
        	tc = sc.next();
        	hc = sc.next();
        	
        	if(tc.compareTo(hc) > 0) {
        		taro += 3;
        	} else if (tc.compareTo(hc) < 0) {
        		hanako += 3;
        	} else {
        		taro++;
        		hanako++;
        	}
        	
        }
        
        System.out.println(taro + " " + hanako);
        
    }
}
