import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc char[] taro; taro char[] hana; hana int tp = 0; tp 0 int hp = 0; hp 0 System.out.println(tp + " " + hp) System.out.println System.out System System.out tp + " " + hp tp + " " + hp tp " " hp String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		char[] taro;
		char[] hana;

		int tp = 0;
		int hp = 0;

		loop:
		for ( int i=0; i<n; i++ ) {
			taro = sc.next().toCharArray();
			hana = sc.next().toCharArray();

			int tl = taro.length;
			int hl = hana.length;
			int len = Math.min(tl, hl);

			for (int j=0; j<len; j++) {
				if ( taro[j] - hana[j] > 0 ) {
					tp += 3;
					continue loop;
				} else if ( taro[j] - hana[j] < 0 ) {
					hp += 3;
					continue loop;
				}
			}

			if ( tl == hl ) {
				tp += 1;
				hp += 1;
				continue loop;
			} else if ( tl > hl ) {
				tp += 3;
				continue loop;
			} else if ( tl < hl ) {
				hp += 3;
				continue loop;
			}
		}

		System.out.println(tp + " " + hp);
	}

}