import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	}

} Main public static void main(String[] args) {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	} main {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	} int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 String taro; taro String hanako; hanako Scanner sc = null; sc null try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		} {
			sc.close();
		} sc.close() sc.close sc {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} sc = new Scanner(System.in) sc new Scanner(System.in) int gameCount = sc.nextInt(); gameCount sc.nextInt() sc.nextInt sc for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			} int i = 0; int i = 0; i 0 i < gameCount i gameCount i++ i++ i {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			} {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			} taro = sc.next() taro sc.next() sc.next sc hanako = sc.next() hanako sc.next() sc.next sc int judge = taro.compareTo(hanako); judge taro.compareTo(hanako) taro.compareTo taro hanako if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				} judge > 0 judge 0 {
					taroPoint += 3;
				} taroPoint += 3 taroPoint 3 if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				} judge < 0 judge 0 {
					hanakoPoint += 3;
				} hanakoPoint += 3 hanakoPoint 3 {
					taroPoint += 1;
					hanakoPoint += 1;
				} taroPoint += 1 taroPoint 1 hanakoPoint += 1 hanakoPoint 1 System.out.println(taroPoint + " " + hanakoPoint) System.out.println System.out System System.out taroPoint + " " + hanakoPoint taroPoint + " " + hanakoPoint taroPoint " " hanakoPoint String[] args args public class Main {

	public static void main(String[] args) {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	}

} public class Main {

	public static void main(String[] args) {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int taroPoint = 0;
		int hanakoPoint = 0;

		String taro;
		String hanako;

		Scanner sc = null;

		try {
			sc = new Scanner(System.in);
			int gameCount = sc.nextInt();

			for (int i = 0; i < gameCount; i++) {
				taro = sc.next();

				hanako = sc.next();

				int judge = taro.compareTo(hanako);

				//?????????????????????
				if (judge > 0) {
					taroPoint += 3;
				}else if(judge < 0){
					hanakoPoint += 3;
				}else{
					taroPoint += 1;
					hanakoPoint += 1;
				}

			}
			System.out.println(taroPoint + " " + hanakoPoint);
		} finally {
			sc.close();
		}
	}

}