import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	}

} 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 tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	}

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	} main {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int tresult = 0; tresult 0 int hresult = 0; hresult 0 for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		} {
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		} String taro = scan.next(); taro scan.next() scan.next scan String hanako = scan.next(); hanako scan.next() scan.next scan if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			} taro.compareTo(hanako) == 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				tresult++;
				hresult++;
			} tresult++ tresult hresult++ hresult if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				hresult += 3;
			} hresult += 3 hresult 3 if(taro.compareTo(hanako) > 0){
				tresult += 3;
			} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				tresult += 3;
			} tresult += 3 tresult 3 System.out.println(tresult + " " + hresult) System.out.println System.out System System.out tresult + " " + hresult tresult + " " + hresult tresult " " hresult String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	}

} 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 tresult = 0;
		int hresult = 0;

		for(int i = 0; i < n; i++){
			String taro = scan.next();
			String hanako = scan.next();

			if(taro.compareTo(hanako) == 0){
				tresult++;
				hresult++;
			}else if(taro.compareTo(hanako) < 0){
				hresult += 3;
			}else if(taro.compareTo(hanako) > 0){
				tresult += 3;
			}
		}
		System.out.println(tresult + " " + hresult);
	}

}