
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	} main {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int intTarouPoint = 0; intTarouPoint 0 int intHanakoPoint = 0; intHanakoPoint 0 int intTurn = sc.nextInt(); intTurn sc.nextInt() sc.nextInt sc for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		} int i = 0; int i = 0; i 0 i < intTurn i intTurn i++ i++ i {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		} {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		} String strTarouCard = sc.next(); strTarouCard sc.next() sc.next sc String strHanakoCard = sc.next(); strHanakoCard sc.next() sc.next sc if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			} 0 < strTarouCard.compareTo(strHanakoCard) 0 strTarouCard.compareTo(strHanakoCard) strTarouCard.compareTo strTarouCard strHanakoCard {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			} intTarouPoint++ intTarouPoint intTarouPoint++ intTarouPoint intTarouPoint++ intTarouPoint if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			} 0 == strTarouCard.compareTo(strHanakoCard) 0 strTarouCard.compareTo(strHanakoCard) strTarouCard.compareTo strTarouCard strHanakoCard {
				intTarouPoint++;
				intHanakoPoint++;
			} intTarouPoint++ intTarouPoint intHanakoPoint++ intHanakoPoint {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			} intHanakoPoint++ intHanakoPoint intHanakoPoint++ intHanakoPoint intHanakoPoint++ intHanakoPoint System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint) System.out.printf System.out System System.out "%d %d%n" intTarouPoint intHanakoPoint String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	}
} Main

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int intTarouPoint = 0;
		int intHanakoPoint = 0;

		int intTurn = sc.nextInt();
		for(int i = 0; i < intTurn; i++) {
			String strTarouCard = sc.next();
			String strHanakoCard = sc.next();
			if(0 < strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intTarouPoint++;
				intTarouPoint++;
			}
			else if(0 == strTarouCard.compareTo(strHanakoCard)) {
				intTarouPoint++;
				intHanakoPoint++;
			}
			else {
				intHanakoPoint++;
				intHanakoPoint++;
				intHanakoPoint++;
			}

		}
		System.out.printf("%d %d%n",intTarouPoint, intHanakoPoint);
	}
}