import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	}

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

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	} main {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int taro = 0; taro 0 int hanako = 0; hanako 0 for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		} {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		} String taroCard = scan.next(); taroCard scan.next() scan.next scan String hanakoCard = scan.next(); hanakoCard scan.next() scan.next scan int tl = taroCard.length(); tl taroCard.length() taroCard.length taroCard int hl = hanakoCard.length(); hl hanakoCard.length() hanakoCard.length hanakoCard int l = 0; l 0 if(tl < hl) l = tl;
			else l = hl; tl < hl tl hl l = tl l tl l = hl l hl char[] tcC = taroCard.toCharArray(); tcC taroCard.toCharArray() taroCard.toCharArray taroCard char[] hcC = hanakoCard.toCharArray(); hcC hanakoCard.toCharArray() hanakoCard.toCharArray hanakoCard int count = 0; count 0 for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				} int i2 = 0; int i2 = 0; i2 0 i2 < l i2 l i2++ i2++ i2 {
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				} {
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				} if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					} tcC[i2] > hcC[i2] tcC[i2] tcC i2 hcC[i2] hcC i2 {
						taro = taro + 3;
						count = 1;
						break;
					} taro = taro + 3 taro taro + 3 taro 3 count = 1 count 1 break; if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					} tcC[i2] < hcC[i2] tcC[i2] tcC i2 hcC[i2] hcC i2 {
						hanako = hanako + 3;
						count = 1;
						break;
					} hanako = hanako + 3 hanako hanako + 3 hanako 3 count = 1 count 1 break; if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				} count == 0 count 0 {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				} if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					} tl > hl tl hl taro = taro +3 taro taro +3 taro 3 if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					} tl < hl tl hl hanako = hanako +3 hanako hanako +3 hanako 3 {
						taro = taro + 1;
						hanako = hanako +1;
					} taro = taro + 1 taro taro + 1 taro 1 hanako = hanako +1 hanako hanako +1 hanako 1 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		// ?????°??????????????°???
		int n = scan.nextInt();
		// ???????????????????´????????????°
		int taro = 0;
		int hanako = 0;
		// ?????????????????????????????§??°?????????
		for(int i = 0; i<n; i++) {
			// ??????????????????
			String taroCard = scan.next();
			String hanakoCard = scan.next();
			// ?????????????????????????????????
			int tl = taroCard.length();
			int hl = hanakoCard.length();
			int l = 0;
			if(tl < hl) l = tl;
			else l = hl;
			// ??????????????????1????????\???char??????????´?
			char[] tcC = taroCard.toCharArray();
			char[] hcC = hanakoCard.toCharArray();
			// 1????????\????????????
				int count = 0;
				for(int i2 = 0; i2 < l; i2++){
					if (tcC[i2] > hcC[i2]) {
						taro = taro + 3;
						count = 1;
						break;
					}
					else if (tcC[i2] < hcC[i2]) {
						hanako = hanako + 3;
						count = 1;
						break;
					}
				}
				if(count == 0) {
					if (tl > hl) taro = taro +3;
					else if (tl < hl) hanako = hanako +3;
					else{
						taro = taro + 1;
						hanako = hanako +1;
					}
				}
		}
		// ??????
		System.out.println(taro + " " + hanako);

	}

}