import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str;
		int tarou=0;
		int hanako=0;
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
} import java.io.*; io.* java class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str;
		int tarou=0;
		int hanako=0;
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
} Main public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str;
		int tarou=0;
		int hanako=0;
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		}
		System.out.println(tarou + " " + hanako);
	} main {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str;
		int tarou=0;
		int hanako=0;
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		}
		System.out.println(tarou + " " + hanako);
	} BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(buf.readLine()); n Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf String[] str; str int tarou=0; tarou 0 int hanako=0; hanako 0 for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		} {
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		} str = buf.readLine().split(" ") str buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			} str[0].compareTo(str[1]) > 0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 tarou += 3 tarou 3 if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			} str[0].compareTo(str[1]) < 0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 hanako += 3 hanako 3 {
				tarou++;
				hanako++;
			} tarou++ tarou hanako++ hanako System.out.println(tarou + " " + hanako) System.out.println System.out System System.out tarou + " " + hanako tarou + " " + hanako tarou " " hanako String args[] args
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str;
		int tarou=0;
		int hanako=0;
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			if(str[0].compareTo(str[1]) > 0)
				tarou += 3;
			else if(str[0].compareTo(str[1]) < 0)
				hanako += 3;
			else {
				tarou++;
				hanako++;
			}
		}
		System.out.println(tarou + " " + hanako);
	}
}