import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		int n;
		String tarocard;
		String hanacard;
		int taropoint = 0;
		int hanapoint = 0;
		final int WIN = 3;

		Scanner stdIn = new Scanner(System.in);

		n = stdIn.nextInt();

		for(int i = 0; i < n; i++) {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		}

		System.out.println(taropoint + " " + hanapoint);

		stdIn.close();
	}
} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {

		int n;
		String tarocard;
		String hanacard;
		int taropoint = 0;
		int hanapoint = 0;
		final int WIN = 3;

		Scanner stdIn = new Scanner(System.in);

		n = stdIn.nextInt();

		for(int i = 0; i < n; i++) {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		}

		System.out.println(taropoint + " " + hanapoint);

		stdIn.close();
	}
} Main public static void main(String[] args) {

		int n;
		String tarocard;
		String hanacard;
		int taropoint = 0;
		int hanapoint = 0;
		final int WIN = 3;

		Scanner stdIn = new Scanner(System.in);

		n = stdIn.nextInt();

		for(int i = 0; i < n; i++) {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		}

		System.out.println(taropoint + " " + hanapoint);

		stdIn.close();
	} main {

		int n;
		String tarocard;
		String hanacard;
		int taropoint = 0;
		int hanapoint = 0;
		final int WIN = 3;

		Scanner stdIn = new Scanner(System.in);

		n = stdIn.nextInt();

		for(int i = 0; i < n; i++) {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		}

		System.out.println(taropoint + " " + hanapoint);

		stdIn.close();
	} int n; n String tarocard; tarocard String hanacard; hanacard int taropoint = 0; taropoint 0 int hanapoint = 0; hanapoint 0 final int WIN = 3; WIN 3 Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) n = stdIn.nextInt() n stdIn.nextInt() stdIn.nextInt stdIn for(int i = 0; i < n; i++) {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		} {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		} tarocard = stdIn.next() tarocard stdIn.next() stdIn.next stdIn hanacard = stdIn.next() hanacard stdIn.next() stdIn.next stdIn if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			} tarocard.equals(hanacard) tarocard.equals tarocard hanacard {
				taropoint++;
				hanapoint++;
			} taropoint++ taropoint hanapoint++ hanapoint if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			} tarocard.compareTo(hanacard) > 0 tarocard.compareTo(hanacard) tarocard.compareTo tarocard hanacard 0 {
				taropoint += WIN;
			} taropoint += WIN taropoint WIN {
				hanapoint += WIN;
			} hanapoint += WIN hanapoint WIN System.out.println(taropoint + " " + hanapoint) System.out.println System.out System System.out taropoint + " " + hanapoint taropoint + " " + hanapoint taropoint " " hanapoint stdIn.close() stdIn.close stdIn String[] args args
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		int n;
		String tarocard;
		String hanacard;
		int taropoint = 0;
		int hanapoint = 0;
		final int WIN = 3;

		Scanner stdIn = new Scanner(System.in);

		n = stdIn.nextInt();

		for(int i = 0; i < n; i++) {
			tarocard = stdIn.next();
			hanacard = stdIn.next();

			if(tarocard.equals(hanacard)) {
				taropoint++;
				hanapoint++;
			} else if(tarocard.compareTo(hanacard) > 0) {
				taropoint += WIN;
			} else {
				hanapoint += WIN;
			}
		}

		System.out.println(taropoint + " " + hanapoint);

		stdIn.close();
	}
}