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