/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
	Scanner scan = new Scanner(System.in);
	List<String> taroList = new ArrayList<String>();
	List<String> hanakoList = new ArrayList<String>();

	int n = scan.nextInt();

	for (int i = 0; i < n; i ++) {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	}

	int tP = 0;
	int hP = 0;

	for (int i = 0; i < n; i ++) {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	}
		
	System.out.println(tP + " " + hP); 

}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
public static void main (String[] args) throws java.lang.Exception
{
	Scanner scan = new Scanner(System.in);
	List<String> taroList = new ArrayList<String>();
	List<String> hanakoList = new ArrayList<String>();

	int n = scan.nextInt();

	for (int i = 0; i < n; i ++) {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	}

	int tP = 0;
	int hP = 0;

	for (int i = 0; i < n; i ++) {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	}
		
	System.out.println(tP + " " + hP); 

}
} Main public static void main (String[] args) throws java.lang.Exception
{
	Scanner scan = new Scanner(System.in);
	List<String> taroList = new ArrayList<String>();
	List<String> hanakoList = new ArrayList<String>();

	int n = scan.nextInt();

	for (int i = 0; i < n; i ++) {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	}

	int tP = 0;
	int hP = 0;

	for (int i = 0; i < n; i ++) {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	}
		
	System.out.println(tP + " " + hP); 

} main {
	Scanner scan = new Scanner(System.in);
	List<String> taroList = new ArrayList<String>();
	List<String> hanakoList = new ArrayList<String>();

	int n = scan.nextInt();

	for (int i = 0; i < n; i ++) {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	}

	int tP = 0;
	int hP = 0;

	for (int i = 0; i < n; i ++) {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	}
		
	System.out.println(tP + " " + hP); 

} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) List<String> taroList = new ArrayList<String>(); taroList new ArrayList<String>() List<String> hanakoList = new ArrayList<String>(); hanakoList new ArrayList<String>() int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for (int i = 0; i < n; i ++) {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	} int i = 0; int i = 0; i 0 i < n i n i ++ i ++ i {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	} {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	} taroList.add(scan.next()) taroList.add taroList scan.next() scan.next scan hanakoList.add(scan.next()) hanakoList.add hanakoList scan.next() scan.next scan int tP = 0; tP 0 int hP = 0; hP 0 for (int i = 0; i < n; i ++) {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	} int i = 0; int i = 0; i 0 i < n i n i ++ i ++ i {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	} {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	} String t = taroList.get(i); t taroList.get(i) taroList.get taroList i String h = hanakoList.get(i); h hanakoList.get(i) hanakoList.get hanakoList i if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		} t.compareTo(h) > 0 t.compareTo(h) t.compareTo t h 0 {
			tP += 3;	
		} tP += 3 tP 3 if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		} t.compareTo(h) < 0 t.compareTo(h) t.compareTo t h 0 {
			hP += 3;
		} hP += 3 hP 3 {
			hP++;
			tP++;
		} hP++ hP tP++ tP System.out.println(tP + " " + hP) System.out.println System.out System System.out tP + " " + hP tP + " " + hP tP " " hP String[] args args
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
	Scanner scan = new Scanner(System.in);
	List<String> taroList = new ArrayList<String>();
	List<String> hanakoList = new ArrayList<String>();

	int n = scan.nextInt();

	for (int i = 0; i < n; i ++) {
		taroList.add(scan.next());
		hanakoList.add(scan.next());	
	}

	int tP = 0;
	int hP = 0;

	for (int i = 0; i < n; i ++) {
		String t = taroList.get(i);
		String h = hanakoList.get(i);
		
		if (t.compareTo(h) > 0) {
			tP += 3;	
		}
		else if (t.compareTo(h) < 0) {
			hP += 3;
		}
		else {
			hP++;
			tP++;
		}
	}
		
	System.out.println(tP + " " + hP); 

}
}