import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	}

} Main public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int point[] = {0,0}; point {0,0} 0 0 for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		} int i = 0 ; int i = 0 ; i 0 i < num i num i++ i++ i {
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		} {
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		} String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			} str[0].compareToIgnoreCase(str[1])>0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 {
				point[0]+=3;
			} point[0]+=3 point[0] point 0 3 if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			} str[0].compareToIgnoreCase(str[1])<0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 {
				point[1]+=3;
			} point[1]+=3 point[1] point 1 3 if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			} str[0].compareToIgnoreCase(str[1])==0 str[0].compareToIgnoreCase(str[1]) str[0].compareToIgnoreCase str[0] str 0 str[1] str 1 0 {
				point[0]++;
				point[1]++;
			} point[0]++ point[0] point 0 point[1]++ point[1] point 1 System.out.println(point[0]+" "+point[1]) System.out.println System.out System System.out point[0]+" "+point[1] point[0]+" "+point[1] point[0] point 0 " " point[1] point 1 String[] args args public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	}

} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		int point[] = {0,0};
		for(int i = 0 ; i < num ; i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareToIgnoreCase(str[1])>0){
				point[0]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])<0){
				point[1]+=3;
			}
			else if(str[0].compareToIgnoreCase(str[1])==0){
				point[0]++;
				point[1]++;
			}
		}
		System.out.println(point[0]+" "+point[1]);

	}

}