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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[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 IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[1]);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[1]);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[1]);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] score = {0, 0}; score {0, 0} 0 0 for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		} {
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		} String[] words = br.readLine().split(" "); words br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			} words[0].compareTo(words[1]) > 0 words[0].compareTo(words[1]) words[0].compareTo words[0] words 0 words[1] words 1 0 {
				score[0] += 3;
			} score[0] += 3 score[0] score 0 3 if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			} words[0].compareTo(words[1]) == 0 words[0].compareTo(words[1]) words[0].compareTo words[0] words 0 words[1] words 1 0 {
				score[0]++;
				score[1]++;
			} score[0]++ score[0] score 0 score[1]++ score[1] score 1 {
				score[1] += 3;
			} score[1] += 3 score[1] score 1 3 System.out.printf("%d %d%n", score[0], score[1]) System.out.printf System.out System System.out "%d %d%n" score[0] score 0 score[1] score 1 String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[1]);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[1]);
	}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] score = {0, 0};
		for(int i = 0;i < n;i++){
			String[] words = br.readLine().split(" ");
			if(words[0].compareTo(words[1]) > 0){
				score[0] += 3;
			}else if(words[0].compareTo(words[1]) == 0){
				score[0]++;
				score[1]++;
			}else{
				score[1] += 3;
			}
		}
		System.out.printf("%d %d%n", score[0], score[1]);
	}

}