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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	}

}
 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) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = 0; n 0 int[] score = new int[2]; score new int[2] 2 try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} NumberFormatException e {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} IOException e {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			} {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			} String[] cardStr = br.readLine().split("\\s"); cardStr br.readLine().split("\\s") br.readLine().split br.readLine() br.readLine br "\\s" if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				} cardStr[0].compareToIgnoreCase(cardStr[1]) > 0 cardStr[0].compareToIgnoreCase(cardStr[1]) cardStr[0].compareToIgnoreCase cardStr[0] cardStr 0 cardStr[1] cardStr 1 0 {
					score[0] = score[0] +3;
				} score[0] = score[0] +3 score[0] score 0 score[0] +3 score[0] score 0 3 if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				} cardStr[0].compareToIgnoreCase(cardStr[1]) < 0 cardStr[0].compareToIgnoreCase(cardStr[1]) cardStr[0].compareToIgnoreCase cardStr[0] cardStr 0 cardStr[1] cardStr 1 0 {
					score[1] = score[1] +3;
				} score[1] = score[1] +3 score[1] score 1 score[1] +3 score[1] score 1 3 {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				} score[0] = score[0] +1 score[0] score 0 score[0] +1 score[0] score 0 1 score[1] = score[1] +1 score[1] score 1 score[1] +1 score[1] score 1 1 System.out.println(score[0] + " " + score[1]) System.out.println System.out System System.out score[0] + " " + score[1] score[0] + " " + score[1] score[0] score 0 " " score[1] score 1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	}

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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = 0;
		int[] score = new int[2];
		
		try {
			n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; i++) {
				String[] cardStr = br.readLine().split("\\s");
				if (cardStr[0].compareToIgnoreCase(cardStr[1]) > 0) {
					score[0] = score[0] +3;
				} else if (cardStr[0].compareToIgnoreCase(cardStr[1]) < 0) {
					score[1] = score[1] +3;
				} else {
					score[0] = score[0] +1;
					score[1] = score[1] +1;
				}
			}
			System.out.println(score[0] + " " + score[1]);
			
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
	}

}

