import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    } main {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int turnNum = sc.nextInt(); turnNum sc.nextInt() sc.nextInt sc int tPoint = 0; tPoint 0 int hPoint = 0; hPoint 0 for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        } int i = 0; int i = 0; i 0 i < turnNum i turnNum i++ i++ i {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        } {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        } String tStr = sc.next(); tStr sc.next() sc.next sc String hStr = sc.next(); hStr sc.next() sc.next sc int check = tStr.compareTo(hStr); check tStr.compareTo(hStr) tStr.compareTo tStr hStr if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	} check < 0 check 0 {
        		hPoint += 3;
        	} hPoint += 3 hPoint 3 if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	} check == 0 check 0 {
        		tPoint += 1;
        		hPoint += 1;
        	} tPoint += 1 tPoint 1 hPoint += 1 hPoint 1 if(check > 0) {
        		tPoint += 3;
        	} check > 0 check 0 {
        		tPoint += 3;
        	} tPoint += 3 tPoint 3 System.out.println(tPoint + " " + hPoint) System.out.println System.out System System.out tPoint + " " + hPoint tPoint + " " + hPoint tPoint " " hPoint String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;

        for(int i = 0; i < turnNum; i++) {
        	String tStr = sc.next();
        	String hStr = sc.next();

        	int check = tStr.compareTo(hStr);
        	if(check < 0) {
        		hPoint += 3;
        	} else if(check == 0) {
        		tPoint += 1;
        		hPoint += 1;
        	} else if(check > 0) {
        		tPoint += 3;
        	}

        }

        System.out.println(tPoint + " " + hPoint);

    }
}
