import java.util.Scanner;

public class Head {
	   public static void main(String []args){
		   Scanner in=new Scanner(System.in);
		   int n,x=-1;
		   x=n=in.nextInt();
		   in.nextLine();
		   String s;
		   for(int i=0;i<--n;i++) {
			   s=in.nextLine();
			   if(s.charAt(1)=='-')
				   x--;
		   }
		   System.out.println(x);
	}
}


import java.util.Scanner;

public class Head {
	   public static void main(String []args){
		   Scanner in=new Scanner(System.in);
		   int n,x=0;
		   n=in.nextInt();
		   in.nextLine();
		   String s;
		   x=n-1;
		   for(int i=0;i<n;i++) {
			   s=in.nextLine();
			   if(s.charAt(1)=='-')
				   x--;
		   }
		   System.out.println(x);
	}
}


import java.util.Scanner;

public class Head {
	   public static void main(String []args){
		   Scanner in=new Scanner(System.in);
		   int n,x;
		   x=n=in.nextInt()-1;
		   in.nextLine();
		   String s;
		   for(int i=0;i<=n;i++) {
			   s=in.nextLine();
			   if(s.charAt(1)=='-')
				   x--;
		   }
		   System.out.println(x);
	}
}


import java.util.Scanner;

public class Head {
	   public static void main(String []args){
		   Scanner in=new Scanner(System.in);
		   int n,x;
		   x=n=in.nextInt();
		   in.nextLine();
		   String s;
		   for(int i=0;i<n;i++) {
			   s=in.nextLine();
			   if(s.charAt(1)=='-')
				   x--;
		   }
		   System.out.println(x);
	}
}


import java.util.Scanner;

public class Head {
	   public static void main(String []args){
		   Scanner in=new Scanner(System.in);
		   int n,x;
		   x=n=in.nextInt();
		   for(int i=0;i<n;i++) {
			   String s=in.nextLine();
			   if(s.charAt(1)=='-')
				   x--;
		   }
		   System.out.println(x);
	}
}


import java.util.Scanner;

public class Head {
	   public static void main(String []args){
		   Scanner in=new Scanner(System.in);
		   int n,x=0;
		   n=in.nextInt();
		   in.nextLine();
		   String s;
		   for(int i=0;i<n;i++) {
			   s=in.nextLine();
			   if(s.charAt(1)=='-')
				   x--;
			   else
				   x++;
		   }
		   System.out.println(x);
	}
}


import java.util.Scanner;

public class A282 {
	public static void main(String []args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int i = 0 ;
		while(n-->0){
			if(in.next().charAt(1)=='+') i++;
			else i--;
		}
		System.out.println(i);
	}
}


import java.util.*;
import java.io.*;
public class Bit
{
	public static void main(String args[])
	{
		try
		{
			int n,t=0;
			String s;
		Scanner sc;
		sc=new Scanner(System.in);
		n=sc.nextInt();
		DataInputStream dis;
		dis=new DataInputStream(System.in);
		while(n>0)
		{
			s=dis.readLine();
			if(s.charAt(1)=='+')
			{
				t++;
			}
			else
			t--;

			n--;
		}
		System.out.println(t);
		}
		catch(IOException e)
		{}

	}

}


import java.util.*;
import java.io.*;
public class Bit
{
	public static void main(String args[])
	{
		try
		{
			int n,t=0,i;
		String s;
		Scanner sc=new Scanner(System.in);
		DataInputStream dis;
		dis=new DataInputStream(System.in);
		n=sc.nextInt();
		for(i=0;i<n;i++)
		{
			s=dis.readLine();
			if(s.equals("++X")||s.equals("X++"))
			{
					t++;
			}
			else
			t--;
		}
		System.out.println(t);
		}
		catch(IOException e)
		{}
	}
}


import java.util.*;
import java.io.*;
public class Bit
{
	public static void main(String args[])
	{
		try
		{
			int n,t=0;
			String s;
		Scanner sc;
		sc=new Scanner(System.in);
		n=sc.nextInt();
		DataInputStream dis;
		char p;
		dis=new DataInputStream(System.in);
		while(n>0)
		{
			s=dis.readLine();
			p=s.charAt(1);
			//System.out.println(s.charAt(1));
			if(p=='+')
			{
				t++;
			}
			else
			t--;

			n--;
		}
		System.out.println(t);
		}
		catch(IOException e)
		{System.out.println(e.getMessage());}

	}

}


import java.util.*;
import java.io.*;
public class Bit
{
	public static void main(String args[])
	{
		try
		{
			int n,t=0;
			String s;
		Scanner sc;
		sc=new Scanner(System.in);
		n=sc.nextInt();
		DataInputStream dis;
		dis=new DataInputStream(System.in);
		while(n>0)
		{
			s=dis.readLine();
			if('+'==s.charAt(1))
			{
				t++;
			}
			else
			t--;

			n--;
		}
		System.out.println(t);
		}
		catch(IOException e)
		{}

	}

}


import java.util.*;
import java.io.*;
public class Bit
{
	public static void main(String x[])
	{
		try
		{
			int n,t=0;
			String s;
		Scanner sc;
		sc=new Scanner(System.in);
		n=sc.nextInt();
		DataInputStream dis;
		dis=new DataInputStream(System.in);
		while(n>0)
		{
			s=dis.readLine();
			if(s.charAt(1)=='+')
			{
				t++;
			}
			else
			t--;

			n--;
		}
		System.out.println(t);
		}
		catch(IOException e)
		{}

	}

}


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

public class Bit {
	public static void main(String [] args) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		//System.out.println("Please enter a value");
		int x = 1;
		int n = Integer.parseInt(bf.readLine());
		//System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


package test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
//import java.util.StringTokenizer;

public class Bit {
	public static void main(String [] asrgs) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Please enter a value");
		int x = 0;
		int n = Integer.parseInt(bf.readLine());
		System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


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

public class Bitx {
	public static void main(String [] args) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		//System.out.println("Please enter a value");
		int x = 0;
		int n = Integer.parseInt(bf.readLine());
		//System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


package test;

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

public class Bit {
	public static void main(String [] asrgs) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Please enter a value");
		int x = 0;
		int n = Integer.parseInt(bf.readLine());
		System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


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

public class Bit {
	public static void main(String [] args) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Please enter a value");
		int x = 0;
		int n = Integer.parseInt(bf.readLine());
		System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


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

public class BitLand {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(bf.readLine());
		int x = 0;
		while(n-->0)
		{
			String s = bf.readLine();
			if(s.equals("X++") || s.equals("++X"))
				x +=1;
			else
				x-=1;
		}
		System.out.println(x);
	}

}


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

public class Bit {
	public static void main(String [] asrgs) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Please enter a value");
		int x = 0;
		int n = Integer.parseInt(bf.readLine());
		System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


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

public class Bit {
	public static void main(String [] args) throws NumberFormatException, IOException
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		//System.out.println("Please enter a value");
		int x = 0;
		int n = Integer.parseInt(bf.readLine());
		//System.out.println("Please enter the operation");
		String y = bf.readLine();
		String [] z = y.split(" ");
		for(int i = 0 ; i <z.length ; i++)
		{
			if (z[i].equals("x++") || z[i].equals("++x"))
				x +=n;
			if (z[i].equals("x--") || z[i].equals("--x"))
				x -=n;
		}
		System.out.print(x);
}
}


import java.util.*;
public class CAMPEONATO {
        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            in.nextLine();
            int x = 0;
            for (int i = 1; i <= veces; i++){
                String linea = in.nextLine().toUpperCase();
                if (linea.equals("X++") || linea.equals("++X")){
                        x=x+1;
                }
                else {
                    x=x-1;
                }
            }
            System.out.println(x);
        }
}


import java.util.*;
public class Prueba{
        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            int x = 0;

            for (int i = 1; i <= veces; i++){
                String linea = in.nextLine();
                if (linea.equals("x++") || linea.equals("++x")){
                        x=x+1;
                }
                else {
                    x=x-1;
                }
            }
            System.out.println(x);
        }
}


import java.util.*;
public class Prueba{
        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            int x = 0;

            for (int i = 1; i <= veces; i++){
                String linea = in.nextLine();
                if (linea.indexOf("+")>0){
                        x++;
                }
                else {
                    x--;
                }
            }
            System.out.println(x);
        }
}


import java.util.*;
public class CAMPEONATO {
        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            in.nextLine();
            int x = 0;
            for (int i = 1; i <= veces; i++){
                String linea = in.nextLine().toUpperCase();
                if (linea.equals("X++") || linea.equals("++X")){
                        x=x+1;
                }
                else {
                    x=x-1;
                }
            }
            System.out.println(x);


import java.util.*;
public class CAMPEONATO {

        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            in.nextLine();
            int x = 0;

            for (int i = 1; i <= veces; i++){
                String linea = in.nextLine().toUpperCase();
                if (linea.equals("X++") || linea.equals("++X")){
                        x=x+1;
                }
                else {
                    x=x-1;
                }
            }
            System.out.println(x);
        }
}


import java.util.*;
public class Prueba{
        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            int x = 0;

            for (int i = 1; i <= veces; i++){
                String linea = in.nextLine().toUpperCase();
                if (linea.equals("X++") || linea.equals("++X")){
                        x=x+1;
                }
                else {
                    x=x-1;
                }
            }
            System.out.println(x);
        }
}


import java.util.*;
public class Prueba{
        public static void main(String args[]){
            Scanner in = new Scanner(System.in);
            int veces = in.nextInt();
            int x = 0;

            for (int i = 1; i <= veces; i++){
                String linea = input.nextLine();
                if (linea.indexOf("+")>0){
                        x++;
                }
                else {
                    x--;
                }
            }
            System.out.println(x);
        }
}


package com.company;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    private static int i=0;
    private static boolean debug=false;
    private static Scanner scanner;

    public static void main(String[] args) throws FileNotFoundException {
	// write your code here

        if (debug) {
            scanner = new Scanner(new File("input.txt"));
        }else {
            scanner = new Scanner(System.in);
        }

        int n=scanner.nextInt();
        for (int i1 = 0; i1 < n; i1++) {
            String s = scanner.nextLine();
            if (s.contains("++")) {
                i++;
            }
            else
            {
                i--;
            }
        }
        System.out.println(i);

    }
}


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
	// write your code here

        /*if (debug) {
            scanner = new Scanner(new File("input.txt"));
        }else {
            scanner = new Scanner(System.in);
        }*/
        Scanner scanner = new Scanner(System.in);

        int i=0;
        int n=scanner.nextInt();
        for (int i1 = 0; i1 < n; i1++) {

                String s = scanner.nextLine();

                if (s.contains("++")) {
                    i++;
                } else {
                    i--;
                }

        }
        System.out.print(i);

    }
}


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
	// write your code here
 System.out.print(1);
 return;
        /*if (debug) {
            scanner = new Scanner(new File("input.txt"));
        }else {
            scanner = new Scanner(System.in);
        }*/
        Scanner scanner = new Scanner(System.in);

        int i=0;
        int n=scanner.nextInt();
        for (int i1 = 0; i1 < n; i1++) {
            if (scanner.hasNext()) {
                String s = scanner.nextLine();

                if (s.contains("++")) {
                    i++;
                } else {
                    i--;
                }
            }
        }
        System.out.print(i);

    }
}


package com.company;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
	// write your code here

        /*if (debug) {
            scanner = new Scanner(new File("input.txt"));
        }else {
            scanner = new Scanner(System.in);
        }*/
        Scanner scanner = new Scanner(System.in);

        int i=0;
        int n=scanner.nextInt();
        for (int i1 = 0; i1 < n; i1++) {
            if (scanner.hasNext()) {
                String s = scanner.nextLine();

                if (s.contains("++")) {
                    i++;
                } else {
                    i--;
                }
            }
        }
        System.out.print(i);

    }
}


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
	// write your code here

        /*if (debug) {
            scanner = new Scanner(new File("input.txt"));
        }else {
            scanner = new Scanner(System.in);
        }*/
        Scanner scanner = new Scanner(System.in);

        int i=0;
        int n=scanner.nextInt();
        for (int i1 = 0; i1 < n; i1++) {
            if (scanner.hasNext()) {
                String s = scanner.nextLine();

                if (s.contains("++")) {
                    i++;
                } else {
                    i--;
                }
            }
        }
        System.out.print(i);

    }
}


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
	// write your code here

        /*if (debug) {
            scanner = new Scanner(new File("input.txt"));
        }else {
            scanner = new Scanner(System.in);
        }*/
        Scanner scanner = new Scanner(System.in);

        int i=0;
        int n=scanner.nextInt();
        for (int i1 = 0; i1 < n; i1++) {

                String s = scanner.nextLine();
                System.out.print(s);
                if (s.contains("++")) {
                    i++;
                } else if(s.contains("--")){
                    i--;
                }

        }
        System.out.print(i);

    }
}


#include <bits/stdc++.h>
using namespace std;

int data1[1111], data2[1123];
char str1[1123], str2[1123];
bool vis[1123];
int main()
{
    int n, i, j;

    scanf("%d", &n);
    {
        scanf("%s %s", str1, str2);
//        memset(vis, false, sizeof(false));
        for(i = 0; i < n; i++)
        {
            data1[i] = str1[i] - '0';
            data2[i] = str2[i] - '0';
        }

        sort(data1, data1 + n);
        sort(data2, data2 + n);

        for(i = 0; i < n; i++)
        {
            for(j = 0; j < n; j++)
            {
                if(data2[j] >= data1[i] && !vis[j])
                {
                    vis[j] = true;
                    break;
                }
            }
        }

        int ans1 = 0;
        for(i = 0; i < n; i++)
        {
            if(!vis[i]) ans1++;
        }
//      for(i=0; i<n; i++)printf("%d ", vis[i]);printf("\n");

        memset(vis, false, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            for(j = 0; j < n; j++)
            {
                if(data2[j] > data1[i] && !vis[j])
                {
                    vis[j] = true;
                    break;
                }
            }
        }

        int ans2 = 0;
        for(i = 0; i < n; i++)
        {
            if(!vis[i]) ans2++;
        }

        printf("%d\n%d\n", ans1, n - ans2);
    }
}


#include <bits/stdc++.h>
using namespace std;

int data1[1111], data2[1123];
char str1[1123], str2[1123];

int main()
{
    int n, i, j;
    bool vis[1123];
    while(~scanf("%d", &n))
    {
        scanf("%s %s", str1, str2);
        memset(vis, false, sizeof(false));
        for(i = 0; i < n; i++)
        {
            data1[i] = str1[i] - '0';
            data2[i] = str2[i] - '0';
        }

        sort(data1, data1 + n);
        sort(data2, data2 + n);

        for(i = 0; i < n; i++)
        {
            for(j = 0; j < n; j++)
            {
                if(data2[j] >= data1[i] && !vis[j])
                {
                    vis[j] = true;
                    break;
                }
            }
        }

        int ans1 = 0;
        for(i = 0; i < n; i++)
        {
            if(!vis[i]) ans1++;
        }

        memset(vis, false, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            for(j = 0; j < n; j++)
            {
                if(data2[j] > data1[i] && !vis[j])
                {
                    vis[j] = true;
                    break;
                }
            }
        }

        int ans2 = 0;
        for(i = 0; i < n; i++)
        {
            if(!vis[i]) ans2++;
        }

        printf("%d\n%d\n", ans1, n - ans2);
    }
}


#include <bits/stdc++.h>
using namespace std;

int data1[1111], data2[1123];
char str1[1123], str2[1123];
bool vis[1123];
int main()
{
    int n, i, j;

    scanf("%d", &n);
    {
        scanf("%s %s", str1, str2);
        memset(vis, false, sizeof(false));
        for(i = 0; i < n; i++)
        {
            data1[i] = str1[i] - '0';
            data2[i] = str2[i] - '0';
        }

        sort(data1, data1 + n);
        sort(data2, data2 + n);

        for(i = 0; i < n; i++)
        {
            for(j = 0; j < n; j++)
            {
                if(data2[j] >= data1[i] && !vis[j])
                {
                    vis[j] = true;
                    break;
                }
            }
        }

        int ans1 = 0;
        for(i = 0; i < n; i++)
        {
            if(!vis[i]) ans1++;
        }
        for(i=0; i<n; i++)printf("%d ", vis[i]);printf("\n");

        memset(vis, false, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            for(j = 0; j < n; j++)
            {
                if(data2[j] > data1[i] && !vis[j])
                {
                    vis[j] = true;
                    break;
                }
            }
        }

        int ans2 = 0;
        for(i = 0; i < n; i++)
        {
            if(!vis[i]) ans2++;
        }

        printf("%d\n%d\n", ans1, n - ans2);
    }
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;

int main()
{
	char s1[MAXN],s2[MAXN];
	int num1[10],num2[10],ans1=0,ans2=0,n,a[10],b[10];
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	scanf("%d",&n);	getchar();
	scanf("%s",s1);	getchar();
	scanf("%s",s2); getchar();
	for (int i=0;i<n;i++)
	{
		num1[int(s1[i])-48]++;
		a[int(s2[i])-48]++;
		num2[int(s2[i])-48]++;
		b[int(s2[i])-48]++;
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (a[j])
			{
				p=true;
				a[j]--;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m+1;j<=9;j++)
		{
			if (b[j])
			{
				p=true;
				b[j]--;
				break;
			}
		}
		if (!p)
		{
			ans2++;
		}
	}
	printf("%d %d",ans1,ans2);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;

int main()
{
	char s1[MAXN],s2[MAXN];
	int num1[10],num2[10],ans1=0,ans2=0,n,a[10],b[10];
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	scanf("%d",&n);	getchar();
	scanf("%s",s1);	getchar();
	scanf("%s",s2); getchar();
	for (int i=0;i<n;i++)
	{
		num1[int(s1[i])-48]++;
		a[int(s2[i])-48]++;
		num2[int(s2[i])-48]++;
		b[int(s2[i])-48]++;
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (a[j])
			{
				p=true;
				a[j]--;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	ans2=n;
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m+1;j<=9;j++)
		{
			if (b[j])
			{
				p=true;
				b[j]--;
				break;
			}
		}
		if (!p)
		{
			ans2--;
		}
	}
	printf("%d %d",ans1,ans2);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;

int main()
{
	char s1[MAXN],s2[MAXN];
	int num1[10],num2[10],ans1=0,ans2=0,n,a[10],b[10];
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%d",&n);	getchar();
	scanf("%s",s1);	getchar();
	scanf("%s",s2); getchar();
	for (int i=0;i<n;i++)
	{
		num1[int(s1[i])-48]++;
		a[int(s2[i])-48]++;
		num2[int(s2[i])-48]++;
		b[int(s2[i])-48]++;
	}
	for (int i=0;i<n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (a[j])
			{
				p=true;
				a[j]--;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	ans2=n;
	for (int i=0;i<n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m+1;j<=9;j++)
		{
			if (b[j])
			{
				p=true;
				b[j]--;
				break;
			}
		}
		if (!p)
		{
			ans2--;
		}
	}
	printf("%d\n%d",ans1,ans2);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;

int main()
{
	char s1[MAXN],s2[MAXN];
	int num1[10],num2[10],ans1=0,ans2=0,n,a[10],b[10];
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%d",&n);	getchar();
	scanf("%s",s1);	getchar();
	scanf("%s",s2); getchar();
	for (int i=0;i<n;i++)
	{
		num1[int(s1[i])-48]++;
		a[int(s2[i])-48]++;
		num2[int(s2[i])-48]++;
		b[int(s2[i])-48]++;
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (a[j])
			{
				p=true;
				a[j]--;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	ans2=n;
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m+1;j<=9;j++)
		{
			if (b[j])
			{
				p=true;
				b[j]--;
				break;
			}
		}
		if (!p)
		{
			ans2--;
		}
	}
	printf("%d\n%d",ans1,ans2);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;

int main()
{
	char s1[MAXN],s2[MAXN];
	int num1[10],num2[10],ans1=0,ans2=0,n,a[10],b[10];
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	scanf("%d",&n);	getchar();
	scanf("%s",s1);	getchar();
	scanf("%s",s2); getchar();
	for (int i=0;i<n;i++)
	{
		num1[int(s1[i])-48]++;
		a[int(s2[i])-48]++;
		num2[int(s2[i])-48]++;
		b[int(s2[i])-48]++;
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (a[j])
			{
				p=true;
				a[j]--;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	ans2=n;
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m+1;j<=9;j++)
		{
			if (b[j])
			{
				p=true;
				b[j]--;
				break;
			}
		}
		if (!p)
		{
			ans--;
		}
	}
	printf("%d %d",ans1,ans2);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;

int main()
{
	char s1[MAXN],s2[MAXN];
	int num1[10],num2[10],ans1=0,ans2=0,n,a[10],b[10];
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	scanf("%d",&n);	getchar();
	scanf("%s",s1);	getchar();
	scanf("%s",s2); getchar();
	for (int i=0;i<n;i++)
	{
		num1[int(s1[i])-48]++;
		a[int(s2[i])-48]++;
		num2[int(s2[i])-48]++;
		b[int(s2[i])-48]++;
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (a[j])
			{
				p=true;
				a[j]--;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	for (int i=1;i<=n;i++)
	{
		bool p=false;
		int m=int(s1[i])-48;
		for (int j=1;j<m;j++)
		{
			if (b[j])
			{
				p=true;
				b[j]--;
				break;
			}
		}
		if (!p)
		{
			ans2++;
		}
	}
	printf("%d %d",ans1,ans2);
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;
int main()
{
	int n,i;
	char x[MAXN],y[MAXN];
	int a[10],b[10],a1[10],b1[10],ans1,ans2;
	bool p;
	scanf("%d",&n);
	getchar();
	scanf("%s",x);
	getchar();
	scanf("%s",y);
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	for (i=0;i<=n-1;i++)
	{
		a[int(x[i])-48]++;
		b[int(y[i])-48]++;
	}
	for (i=0;i<=9;i++)
	{
		a1[i]=a[i];
		b1[i]=b[i];
	}
	ans1=0;
	ans2=0;
	for (i=0;i<=n-1;i++)
	{
		p=false;
		int m=int(x[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (b1[j]>0)
			{
				b1[j]--;
				p=true;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	for (i=0;i<=9;i++)
	{
		a1[i]=a[i];
		b1[i]=b[i];
	}
	ans2=n;
	for (i=0;i<=n-1;i++)
	{
		p=false;
		int m=int(x[i])-48;
		for (int j=m+1;j<=9;j++)
		{
			if (b1[j]>0)
			{
				b1[j]--;
				p=true;
				break;
			}
		}
		if (!p)
		{
			ans2--;
		}
	}
	cout<<ans1<<' '<<ans2;
    return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>

using namespace std;

const int MAXN=1010;
int main()
{
	int n,i;
	char x[MAXN],y[MAXN];
	int a[10],b[10],a1[10],b1[10],ans1,ans2;
	bool p;
	scanf("%d",&n);
	getchar();
	scanf("%s",x);
	getchar();
	scanf("%s",y);
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	for (i=0;i<=n-1;i++)
	{
		a[int(x[i])-48]++;
		b[int(y[i])-48]++;
	}
	for (i=0;i<=9;i++)
	{
		a1[i]=a[i];
		b1[i]=b[i];
	}
	ans1=0;
	ans2=0;
	for (i=0;i<=n-1;i++)
	{
		p=false;
		int m=int(a[i])-48;
		for (int j=m;j<=9;j++)
		{
			if (b1[j]>0)
			{
				b1[j]--;
				p=true;
				break;
			}
		}
		if (!p)
		{
			ans1++;
		}
	}
	for (i=0;i<=9;i++)
	{
		a1[i]=a[i];
		b1[i]=b[i];
	}
	ans2=n;
	for (i=0;i<=n-1;i++)
	{
		p=false;
		int m=int(a[i])-48;
		for (int j=m-1;j>=0;j--)
		{
			if (b1[j]>0)
			{
				b1[j]--;
				p=true;
				break;
			}
		}
		if (!p)
		{
			ans2--;
		}
	}
	cout<<ans1<<' '<<ans2;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#define N 1010
using namespace std;

int a[N],aa[N],b[N],bb[N],flag[N];
char ch[N],ch1[N];
int main()
{
	int n;cin>>n;
	scanf("%s%s",ch,ch1);
	for(int i=0;i<n;i++){
		a[i+1]=ch[i]-'0';
		b[i+1]=ch1[i]-'0';
	}
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	int i=1,j=1,ans1=0,ans2=0;
	while(i<=n&&j<=n){
		if(a[i]>b[j]){
			ans1++,j++;continue;
		}
		else i++,j++;
	}
	i=1,j=1;
	while(i<=n&&j<=n){
		if(a[i]>=b[j]){
			j++;continue;
		}
		if(b[j]>a[i])ans2++,i++,j++;
	}
	cout<<ans1<<endl<<ans2;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#define N 1010
using namespace std;

int a[N],aa[N],b[N],bb[N],flag[N];
char ch[N];
int main()
{
	int n;
	cin>>n;
	scanf("%s",ch);
	int len=strlen(ch);
	for(int i=1;i<=len;i++){
		a[i]=ch[i-1]-'0';
		aa[i]=a[i];
	}
	sort(a+1,a+1+n);
	scanf("%s",ch);
	for(int i=1;i<=n;i++){
		b[i]=ch[i-1]-'0';
		bb[i]=b[i];
	}
	sort(b+1,b+1+n);
	int l=1,r=1,ans1=0;
	for(int i=1;i<=n;i++){
		if(a[l]==b[r])l++,r++;
		if(a[l]<b[r])l++;
		if(a[l]>b[r])r++,ans1++;
	}
	int ll=1,ans=0;
	for(int i=1;i<=n;i++){
		int stan=a[i];
		for(int j=ll;j<=n;j++){
			if(b[j]>stan&&!flag[b[j]])ll=j,ans++,flag[b[j]]=1;
			if(j==n){
				for(int k=ll;k<=n;k++)
					if(!flag[b[k]])
						flag[b[k]]=1;
			}
		}
	}
	cout<<ans1<<endl<<ans;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#define N 1010
using namespace std;

int a[N],aa[N],b[N],bb[N],flag[N];
char ch[N];
int main()
{
	int n;
	cin>>n;
	scanf("%s",ch);
	int len=strlen(ch);
	for(int i=1;i<=len;i++){
		a[i]=ch[i-1]-'0';
		aa[i]=a[i];
	}
	sort(a+1,a+1+n);
	scanf("%s",ch);
	for(int i=1;i<=n;i++){
		b[i]=ch[i-1]-'0';
		bb[i]=b[i];
	}
	sort(b+1,b+1+n);
	int l=1,r=1,ans1=0,ans=0;
	while(l<=n&&r<=n){
		if(a[l]<=b[r])l++,r++;
		if(a[l]>b[r])r++,ans1++;
	}
	l=1,r=1;
	while(l<=n&&r<=n){
		if(a[l]>=b[r])r++;
		if(a[l]<b[r])l++,r++,ans++;
	}
	cout<<ans1<<endl<<ans;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#define N 1010
using namespace std;

int a[N],aa[N],b[N],bb[N],flag[N];
char ch[N];
int main()
{
	int n;
	cin>>n;
	scanf("%s",ch);
	int len=strlen(ch);
	for(int i=1;i<=len;i++){
		a[i]=ch[i-1]-'0';
		aa[i]=a[i];
	}
	sort(a+1,a+1+n);
	scanf("%s",ch);
	for(int i=1;i<=n;i++){
		b[i]=ch[i-1]-'0';
		bb[i]=b[i];
	}
	sort(b+1,b+1+n);
	int l=1,r=1,ans1=0,ans=0;
	while(l<=n&&r<=n){
		if(a[l]==b[r])l++,r++;
		if(a[l]<b[r])l++;
		if(a[l]>b[r])r++,ans1++;
	}
	l=1,r=1;
	while(l<=n&&r<=n){
		if(a[l]>=b[r])r++;
		if(a[l]<b[r])l++,r++,ans++;
	}
	cout<<ans1<<endl<<ans;
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
int t[20], f, p;
int main()
{
	int n ;
	cin >> n;
	string a, b;
	cin >> a >> b;
	for(int i=0;i<n;i++)
	{
		int y = b[i]-'0';
		t[y]++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int j=x;j<10;j++)
		{
			if(t[j]>0)
			{
				flag = 1;
				t[j]--;
				break;
			}
		}
		if(!flag)
			f++;
	}
	fill(t, t+20, 0);
	for(int i=0;i<n;i++)
	{
		int y = b[i]-'0';
		t[y]++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int j=x+1;j<10;j++)
		{
			if(t[j]>0)
			{
				flag = 1;
				t[j]--;
				break;
			}
		}
		if(flag)
			p++;
	}
	cout << f << endl<< p << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
int t[20], f, p;
int main()
{
	int n ;
	cin >> n;
	string a, b;
	cin >> a >> b;
	for(int i=0;i<n;i++)
	{
		int y = b[i]-'0';
		t[y]++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int j=x;j<10;j++)
		{
			if(t[j]>0)
			{
				flag = 1;
				t[j]--;
				break;
			}
		}
		if(!flag)
			f++;
	}
	fill(t, t+n, 0);
	for(int i=0;i<n;i++)
	{
		int y = b[i]-'0';
		t[y]++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int j=x+1;j<10;j++)
		{
			if(t[j]>0)
			{
				flag = 1;
				t[j]--;
				break;
			}
		}
		if(flag)
			p++;
	}
	cout << f << endl<< p << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
int t[10], f, p;
int main()
{
	int n ;
	cin >> n;
	string a, b;
	cin >> a >> b;
	for(int i=0;i<n;i++)
	{
		t[b[i]-'0']++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int i=x;i<10;i++)
		{
			if(t[i]>0)
			{
				flag = 1;
				t[i]--;
				break;
			}
		}
		if(!flag)
			f++;
	}
	fill(t, t+n, 0);
	for(int i=0;i<n;i++)
	{
		t[b[i]-'0']++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int i=x+1;i<10;i++)
		{
			if(t[i]>0)
			{
				flag = 1;
				t[i]--;
				break;
			}
		}
		if(flag)
			p++;
	}
	cout << f << endl<< p << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
int t[20], f, p;
int main()
{
	int n ;
	cin >> n;
	string a, b;
	cin >> a >> b;
	for(int i=0;i<n;i++)
	{
		t[b[i]-'0']++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int i=x;i<10;i++)
		{
			if(t[i]>0)
			{
				flag = 1;
				t[i]--;
				break;
			}
		}
		if(!flag)
			f++;
	}
	fill(t, t+n, 0);
	for(int i=0;i<n;i++)
	{
		t[b[i]-'0']++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int i=x+1;i<10;i++)
		{
			if(t[i]>0)
			{
				flag = 1;
				t[i]--;
				break;
			}
		}
		if(flag)
			p++;
	}
	cout << f << endl<< p << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
int t[20], f, p;
int main()
{
	int n ;
	cin >> n;
	string a, b;
	cin >> a >> b;
	for(int i=0;i<n;i++)
	{
		t[(int)(b[i]-'0')]++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int i=x;i<10;i++)
		{
			if(t[i]>0)
			{
				flag = 1;
				t[i]--;
				break;
			}
		}
		if(!flag)
			f++;
	}
	fill(t, t+n, 0);
	for(int i=0;i<n;i++)
	{
		t[(int)(b[i]-'0')]++;
	}
	for(int i=0;i<n;i++)
	{
		bool flag=0;
		int x=a[i]-'0';
		for(int i=x+1;i<10;i++)
		{
			if(t[i]>0)
			{
				flag = 1;
				t[i]--;
				break;
			}
		}
		if(flag)
			p++;
	}
	cout << f << endl<< p << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int a[123456];

int main()
{
    int n;
    cin >> n;
    string s1,s2,s3,s4;
    cin >> s1 >> s2;
    s3 = s1;
    s4 = s2;
    sort(s2.begin(),s2.end());
    sort(s1.begin(),s1.end());
    //cout << s2 << endl;
    int cnt1 = 0,cnt2 = 0;
    if(s1 == s2){
        cout << 0 << endl;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s2[i] > s1[j]){
                    cnt2++;
                    s3[j] = '9';
                    break;
                }
            }
        }
        cout << cnt2 << endl;
    }
    else{
        for(int i = 0; i < n; i++){
              if(s1[i] > s2[i])
                cnt1++;
            }
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s1[i] < s2[j])
                {
                    cnt2++;
                    s2[j] = '0';
                    break;
                }
            }
        }
        cout << cnt1 << endl;
        cout << cnt2 << endl;
    }

    //for(int i = 0; i < n; i++)
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int a[123456];

int main()
{
    int n;
    cin >> n;
    string s1,s2,s3,s4;
    cin >> s1 >> s2;
    s3 = s1;
    s4 = s2;
    sort(s2.begin(),s2.end());
    sort(s1.begin(),s1.end());
    //cout << s2 << endl;
    int cnt1 = 0,cnt2 = 0;
    sort(s3.begin(),s3.end());
    sort(s4.begin(),s4.end());
    if(s1 == s2){
        cout << 0 << endl;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s2[i] > s1[j]){
                    cnt2++;
                    s1[j] = '9';
                    break;
                }
            }
        }
        cout << cnt2 << endl;
    }
    else{
        for(int i = 0; i < n; i++){
                for(int j = 0; j < n; j++){
                    if(s4[i] >= s3[j]){
                        cnt1++;
                        s3[j] = '9';
                        break;
                    }
                }
            }
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s2[i] > s1[j]){
                    cnt2++;
                    s1[j] = '9';
                    break;
                }
            }
        }
        cnt1 = s3.size() - cnt1;
        cout << cnt1 << endl;
        cout << cnt2 << endl;

    }

    //for(int i = 0; i < n; i++)
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int a[123456];

int main()
{
    int n;
    cin >> n;
    string s1,s2,s3,s4;
    cin >> s1 >> s2;
    s3 = s1;
    s4 = s2;
    sort(s2.begin(),s2.end());
    sort(s1.begin(),s1.end());
    //cout << s2 << endl;
    int cnt1 = 0,cnt2 = 0;
    sort(s3.begin(),s3.end());
    sort(s4.begin(),s4.end());
    if(s1 == s2){
        cout << 0 << endl;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s2[i] > s1[j]){
                    cnt2++;
                    s1[j] = '9';
                    break;
                }
            }
        }
        cout << cnt2 << endl;
    }
    else{
        for(int i = 0; i < n; i++){
                for(int j = 0; j < n; j++){
                    if(s4[i] >= s3[j]){
                        cnt1++;
                        s3[j] = '9';
                        break;
                    }
                }
            }
        cnt2 = cnt1;
        cnt1 = s3.size() - cnt1;
        cout << cnt1 << endl;
        cout << cnt2 << endl;

    }

    //for(int i = 0; i < n; i++)
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int a[123456];

int main()
{
    int n;
    cin >> n;
    string s1,s2,s3,s4;
    cin >> s1 >> s2;
    s3 = s1;
    s4 = s2;
    sort(s2.begin(),s2.end());
    sort(s1.begin(),s1.end());
    //cout << s2 << endl;
    int cnt1 = 0,cnt2 = 0;
    if(s1 == s2){
        cout << 0 << endl;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s4[i] > s3[j]){
                    cnt2++;
                    break;
                }
            }
        }
        cout << cnt2 << endl;
    }
    else{
        for(int i = 0; i < n; i++){
              if(s1[i] > s2[i])
                cnt1++;
            }
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s3[i] < s4[j])
                {
                    cnt2++;
                    break;
                }
            }
        }
        cout << cnt1 << endl;
        cout << cnt2 << endl;
    }

    //for(int i = 0; i < n; i++)
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int a[123456];

int main()
{
    int n;
    cin >> n;
    string s1,s2,s3,s4;
    cin >> s1 >> s2;
    s3 = s1;
    s4 = s2;
    sort(s2.begin(),s2.end());
    sort(s1.begin(),s1.end());
    //cout << s2 << endl;
    int cnt1 = 0,cnt2 = 0;
    if(s1 == s2){
        cout << 0 << endl;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s2[i] > s1[j]){
                    cnt2++;
                    s1[j] = '9';
                    break;
                }
            }
        }
        cout << cnt2 << endl;
    }
    else{
        for(int i = 0; i < n; i++){
              if(s1[i] > s2[i])
                cnt1++;
            }
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(s2[i] > s1[j]){
                    cnt2++;
                    s1[j] = '9';
                    break;
                }
            }
        }
        cout << cnt1 << endl;
        cout << cnt2 << endl;

    }

    //for(int i = 0; i < n; i++)
    return 0;
}


#include <stdio.h>
#include <algorithm>
using namespace std;
int T[1002],K[1002],n,win,lose;
char a[1002],b[1002];
void read()
{
    scanf("%s%s",a,b);
    for(int i=0;i<n;i++)
        K[i]=a[i]-'0';
    for(int i=0;i<n;i++)
        T[i]=b[i]-'0';
    sort(T,T+n);
    sort(K,K+n);
}
void race()
{
    win = lose =0;
    int t_slow=0,t_fast=n-1;
    int k_slow=0,k_fast=n-1;
    while(t_slow <= t_fast)
    {
        if(T[t_slow] > K[k_slow])        //���1
        {
            win++;
            t_slow++;
            k_slow++;
        }
        else if(T[t_slow] < K[k_slow])   //���2
        {
            lose++;
            t_slow++;
            k_fast--;
        }
        else                             //���3
        {
            if(T[t_fast] > K[k_fast])    //�ȱ��ˮ���ø�����ⳡ
            {
                win++;
                t_fast--;
                k_fast--;
            }
            else                         //1��2��3����
            {
                if(T[t_slow] < K[k_fast])//�粻һ������Ŷ~~~
                    lose++;
                t_slow++;
                k_fast--;
            }
        }
    }
}
int main()
{
    //freopen("1","r",stdin);
    //freopen("2","w",stdout);
    while(scanf("%d",&n),n)
    {
        read();
        race();
        if(win-lose>=0) {
        	printf("%d\n",0);
			printf("%d\n",n-abs(win-lose));
		}
        else{
        	printf("%d\n",abs(win-lose));
            printf("%d\n",n-abs(win-lose));
  }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int T[1050],K[1050],n,win,lose;
char a[1050],b[1050];
void read()
{
    scanf("%s%s",a,b);
    for(int i=0;i<n;i++)
        K[i]=a[i]-'0';
    for(int i=0;i<n;i++)
        T[i]=b[i]-'0';
    sort(T,T+n);
    sort(K,K+n);
}
void race()
{
    win = lose =0;
    int t_slow=0,t_fast=n-1;
    int k_slow=0,k_fast=n-1;
    while(t_slow <= t_fast)
    {
        if(T[t_slow] > K[k_slow])        //���1
        {
            win++;
            t_slow++;
            k_slow++;
        }
        else if(T[t_slow] < K[k_slow])   //���2
        {
            lose++;
            t_slow++;
            k_fast--;
        }
        else                             //���3
        {
            if(T[t_fast] > K[k_fast])    //�ȱ��ˮ���ø�����ⳡ
            {
                win++;
                t_fast--;
                k_fast--;
            }
            else                         //1��2��3����
            {
                if(T[t_slow] < K[k_fast])//�粻һ������Ŷ~~~
                    lose++;
                t_slow++;
                k_fast--;
            }
        }
    }
}
int main()
{
    //freopen("1","r",stdin);
    //freopen("2","w",stdout);
      scanf("%d",&n);
        read();
        race();
        if(win-lose>=0) {
        	printf("%d\n",0);
			printf("%d\n",n-abs(win-lose));
		}
        else{
        	printf("%d\n",abs(win-lose));
            printf("%d\n",n-abs(win-lose));
  }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int N = 1e3 + 10;

char a[N], b[N];

int main ()
{
	int n, i;
	scanf("%d %s %s", &n, a, b);
	sort(a, a+n); sort(b, b+n);
	i = 0;
	for(int j = 0; j < n; j++){
		if(b[j] >= a[i])
			i++;
	}
	printf("%d\n", n-i);

	i = 0;
	for(int j = 0; j < n; j++){
		if(b[j] > a[i])
			i++;
	}
	printf("%d\n", i);

	return 0;
}


#include <stdio.h>
#include <algorithm>
using namespace std;
int T[1002],K[1002],n,win,lose;
char a[1002],b[1002];
void read()
{
    scanf("%s%s",a,b);
    for(int i=0;i<n;i++)
        K[i]=a[i]-'0';
    for(int i=0;i<n;i++)
        T[i]=b[i]-'0';
    sort(T,T+n);
    sort(K,K+n);
}
void race()
{
    win = lose =0;
    int t_slow=0,t_fast=n-1;
    int k_slow=0,k_fast=n-1;
    while(t_slow <= t_fast)
    {
        if(T[t_slow] > K[k_slow])        //���1
        {
            win++;
            t_slow++;
            k_slow++;
        }
        else if(T[t_slow] < K[k_slow])   //���2
        {
            lose++;
            t_slow++;
            k_fast--;
        }
        else                             //���3
        {
            if(T[t_fast] > K[k_fast])    //�ȱ��ˮ���ø�����ⳡ
            {
                win++;
                t_fast--;
                k_fast--;
            }
            else                         //1��2��3����
            {
                if(T[t_slow] < K[k_fast])//�粻һ������Ŷ~~~
                    lose++;
                t_slow++;
                k_fast--;
            }
        }
    }
}
int main()
{
    //freopen("1","r",stdin);
    //freopen("2","w",stdout);
        scanf("%d",&n);
        read();
        race();
        if(win-lose>=0) {
        	printf("%d\n",0);
			printf("%d\n",win);
		}
        else{
        	printf("%d\n",abs(lose));
            printf("%d\n",win);
  }
    return 0;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-8;
const int MAX=1e5+10;
const ll mod=1e9+7;
int main()
{
	int n,i,j,ans1,ans2,r;
	char a[1111],b[1111];
	while(~scanf("%d",&n))
	{
		scanf("%s%s",a,b);
		sort(a,a+n);
		sort(b,b+n);
		ans1=0;
		ans2=0;
		r=0;
		for(i=0;i<n&&r<n;i++,r++)
		{
			while(r<n&&b[r]<a[i]) r++;
			ans1+=r-i;
		}
		r=0;
		for(i=0;i<n&&r<n;i++)
		{
			while(r<n&&b[r]<=a[i]) r++;
			if(r<n&&b[r]>a[i])ans2++;
		}
		printf("%d\n%d\n",ans1,ans2);
	}
	return 0;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-8;
const int MAX=1e5+10;
const ll mod=1e9+7;
int main()
{
	int n,i,j,ans1,ans2,r;
	char a[1111],b[1111];
	while(~scanf("%d",&n))
	{
		scanf("%s%s",a,b);
		sort(a,a+n);
		sort(b,b+n);
		ans1=0;
		ans2=0;
		r=0;
		for(i=0;i<n&&r<n;i++,r++)
		{
			while(r<n&&b[r]<a[i]) r++;
			ans1+=r-i;
		}
		r=0;
		for(i=0;i<n&&r<n;i++)
		{
			while(r<n&&b[r]<=a[i]) r++;
			if(r<n&&b[r]>a[i]) ans2++,r++;
		}
		printf("%d\n%d\n",ans1,ans2);
	}
	return 0;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-8;
const int MAX=1e5+10;
const ll mod=1e9+7;
int main()
{
	int n,i,j,ans1,ans2,r;
	char a[1111],b[1111];
	while(~scanf("%d",&n))
	{
		scanf("%s%s",a,b);
		sort(a,a+n);
		sort(b,b+n);
		ans1=0;
		ans2=0;
		r=0;
		for(i=0;i<n&&r<n;i++)
		{
			while(r<n&&b[r]>=a[i]) r++;
			if(r<n&&b[r]<a[i]) ans1++,r++;
		}
		r=0;
		for(i=0;i<n&&r<n;i++)
		{
			while(r<n&&b[r]<=a[i]) r++;
			if(r<n&&b[r]>a[i]) ans2++,r++;
		}
		printf("%d\n%d\n",ans1,ans2);
	}
	return 0;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-8;
const int MAX=1e5+10;
const ll mod=1e9+7;
int main()
{
	int n,i,j,ans1,ans2,r;
	char a[1111],b[1111];
	while(~scanf("%d",&n))
	{
		scanf("%s%s",a,b);
		sort(a,a+n);
		sort(b,b+n);
		ans1=0;
		ans2=0;
		r=0;
		for(i=0;i<n&&r<n;i++)
		{
			while(r<n&&b[r]<a[i]) r++;
			if(r<n&&b[r]>=a[i]) ans1++,r++;
		}
		ans1=n-ans1;
		r=0;
		for(i=0;i<n&&r<n;i++)
		{
			while(r<n&&b[r]<=a[i]) r++;
			if(r<n&&b[r]>a[i]) ans2++,r++;
		}
		printf("%d\n%d\n",ans1,ans2);
	}
	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
   		int n,bsc=0,j,mflick=0,i=0;
	    cin>>n;
	    string s1,s2;
	    int sc[n];
	    int sc2[n];
	    int mc[n];
	    int mc2[n];
	    int mc3[n];
	    char c;

	    cin>>s1;
	    for(i=0;i<n;i++){
	        c = s1.at(i);
	        sc[i] = c-'0';
	        sc2[i] = c-'0';
	    }

	    cin>>s2;
	    for(i=0;i<n;i++){
	    	c = s2.at(i);
	        mc[i] = c-'0';
	        mc2[i] = c-'0';
	        mc3[i] = c-'0';
	    }

        int k=0;bool found = false;
	    for(i=0;i<n;i++){
            sort(mc2,mc2+n);
            for(j=0;j<n;j++){
                if(mc2[j]!=-1 && sc2[i]==mc2[j]){
                    mc2[j]=-1;
                    sc2[i] = -1;
                    bsc++;
                    break;
                }
            }
	    }

	    for(i=0;i<n;i++){
            sort(mc2,mc2+n);
            for(j=0;j<n;j++){
                if(mc2[j]!=-1 && sc2[i]!=-1 && mc2[j]>sc2[i]){
                    mc2[j]=-1;
                    bsc++;
                    break;
                }
            }
	    }

	    for(i=0;i<n;i++){
	    	sort(mc,mc + n);

	    	for(j=0;j<n;j++){
	    		if(mc[j]>sc[i]){
	    			mc[j] = -1;
	    			mflick++;
	    			break;
	    		}
	    	}
	    }

        cout<<n-bsc<<endl;
        cout<<mflick;

    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
   		int n,bsc=0,j,mflick=0,i=0;
	    cin>>n;
	    string s1,s2;
	    int sc[n];
	    int mc[n];
	    char c;

	    cin>>s1;
	    for(i=0;i<n;i++){
	        c = s1.at(i);
	        sc[i] = c-'0';
	    }

	    cin>>s2;
	    for(i=0;i<n;i++){
	    	c = s2.at(i);
	        mc[i] = c-'0';
	    }

		bool found;
	    for(i=0;i<n;i++){
	        found = false;
	    	for(j=0;j<n;j++){
	            if(sc[i]<=mc[j]){
	                found=true;
	            	break;
	            }
	        }
	        if(found==false){
	            bsc=bsc+1;
	        }
	    }

	    for(i=0;i<n;i++){
            sort(mc,mc + n);

	    	for(j=0;j<n;j++){
	    		if(mc[j]>sc[i]){
	    			mc[j] = -1;
	    			mflick++;
	    			break;
	    		}
	    	}
	    }

        cout<<bsc<<endl;
        cout<<mflick;

    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
   		int n,bsc=0,j,mflick=0,i=0;
	    cin>>n;
	    string s1,s2;
	    int sc[n];
	    int mc[n];
	    char c;

	    cin>>s1;
	    for(i=0;i<n;i++){
	        c = s1.at(i);
	        sc[i] = c-'0';
	    }

	    cin>>s2;
	    for(i=0;i<n;i++){
	    	c = s2.at(i);
	        mc[i] = c-'0';
	    }

		bool found;
	    for(i=0;i<n;i++){
	        found = false;
	    	for(j=0;j<n;j++){
	            if(sc[i]<=mc[j]){
	                found=true;
	            	break;
	            }
	        }
	        if(found==false){
	            bsc=bsc+1;
	        }
	    }

	    for(i=0;i<n;i++){
	    	found = false;
            sort(mc,mc + n);

	    	for(j=0;j<n;j++){
	    		if(mc[j]>sc[i]){
	    			found = true;
	    			mc[j] = -1;
	    			mflick++;
	    			break;
	    		}
	    	}
	    	if(found==false){
				cout<<bsc<<endl;
				cout<<mflick;
				return 0;
			}
	    }

        cout<<bsc<<endl;
        cout<<mflick;

    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
   		int n,bsc=0,j,mflick=0,i=0;
	    cin>>n;
	    string s1,s2;
	    int sc[n];
	    int sc2[n];
	    int mc[n];
	    int mc2[n];
	    int mc3[n];
	    char c;

	    cin>>s1;
	    for(i=0;i<n;i++){
	        c = s1.at(i);
	        sc[i] = c-'0';
	        //sc2[i] = c-'0';
	    }

	    cin>>s2;
	    for(i=0;i<n;i++){
	    	c = s2.at(i);
	        mc[i] = c-'0';
	        mc2[i] = c-'0';
	        mc3[i] = c-'0';
	    }

        int k=0;bool found = false;
	    for(i=0;i<n;i++){
            sort(mc2,mc2+n);
            for(j=0;j<n;j++){
                if(mc2[j]!=-1 && sc[i]==mc2[j]){
                    mc2[j]=-1;
                    bsc++;
                    break;
                }
            }
	    }

	    for(i=bsc;i<n;i++){
            sort(mc2,mc2+n);
            for(j=bsc;j<n;j++){
                if(mc2[j]!=-1 && mc2[j]>sc[i]){
                    mc2[j]=-1;
                    bsc++;
                    break;
                }
            }
	    }

	    for(i=0;i<n;i++){
	    	sort(mc,mc + n);

	    	for(j=0;j<n;j++){
	    		if(mc[j]>sc[i]){
	    			mc[j] = -1;
	    			mflick++;
	    			break;
	    		}
	    	}
	    }

        cout<<n-bsc<<endl;
        cout<<mflick;

    return 0;
}


#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN=1e3+5;
void swap(int &a,int &b){
    int temp=a;a=b;b=temp;
}
int main(){
    int  a[MAXN],b[MAXN];
    int Len;scanf("%d",&Len);getchar();
    int i;
    for(i=0;i<Len;++i){
        char ch=getchar();
        a[i]=ch-'0';
    }
    getchar();
    for(i=0;i<Len;++i){
        char ch=getchar();
        b[i]=ch-'0';
    }
    sort(a,a+Len);
    sort(b,b+Len);
    int minGet=0;
    for(i=0;i<Len;++i){
        int pos=lower_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i-1]);
        }
        sort(b,b+Len-i-1);
    }
    minGet=Len-i;
    int maxGiv=0;
    sort(b,b+Len);
    for(i=0;i<Len;++i){
        int pos=upper_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i-1]);
            ++maxGiv;
        }
        /*for(int i=0;i<Len-i;++i)
            printf("%d\t",a[i]);
        printf("\n");*/
        sort(b,b+Len-i-1);
    }
    maxGiv=i;
    printf("%d\n",minGet);
    printf("%d\n",maxGiv);
    //return main();
}


#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN=1e3+5;
void swap(int &a,int &b){
    int temp=a;a=b;b=temp;
}
int main(){
    int  a[MAXN],b[MAXN];
    int Len;scanf("%d",&Len);getchar();
    int i;
    for(i=0;i<Len;++i){
        char ch=getchar();
        a[i]=ch-'0';
    }
    getchar();
    for(i=0;i<Len;++i){
        char ch=getchar();
        b[i]=ch-'0';
    }
    sort(b,b+Len);
    int minGet=0;
    for(i=0;i<Len;++i){
        int pos=lower_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i-1]);
        }
        sort(b,b+Len-i-1);
    }
    minGet=Len-i;
    int maxGiv=0;
    sort(b,b+Len);
    for(i=0;i<Len;++i){
        int pos=upper_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i-1]);
            ++maxGiv;
        }
        /*for(int i=0;i<Len-i;++i)
            printf("%d\t",a[i]);
        printf("\n");*/
        sort(b,b+Len-i-1);
    }
    maxGiv=i;
    printf("%d\n",minGet);
    printf("%d\n",maxGiv);
}


#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN=1e3+5;
void swap(int &a,int &b){
    int temp=a;a=b;b=temp;
}
int main(){
    int  a[MAXN],b[MAXN];
    int Len;scanf("%d",&Len);getchar();
    for(int i=0;i<Len;++i){
        char ch=getchar();
        a[i]=ch-'0';
    }
    getchar();
    for(int i=0;i<Len;++i){
        char ch=getchar();
        b[i]=ch-'0';
    }
    sort(b,b+Len);
    int minGet=0;
    int i;
    for(i=0;i<Len;++i){
        int pos=lower_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i-1]);
        }
        sort(b,b+Len-i-1);
    }
    minGet=Len-i;
    int maxGiv=0;
    for(i=0;i<Len;++i){
        int pos=upper_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i]);
            ++maxGiv;
        }
        /*for(int i=0;i<Len-i;++i)
            printf("%d\t",a[i]);
        printf("\n");*/
        sort(b,b+Len-i-1);
    }
    maxGiv=i;
    printf("%d\n",minGet);
    printf("%d\n",maxGiv);
}


#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAXN=1e3+5;
void swap(int &a,int &b){
    int temp=a;a=b;b=temp;
}
int main(){
    int  a[MAXN],b[MAXN];
    int Len;scanf("%d",&Len);
    for(int i=0;i<Len;++i){
        char ch;cin>>ch;
        a[i]=ch-'0';
    }
    for(int i=0;i<Len;++i){
        char ch;cin>>ch;
        b[i]=ch-'0';
    }
    sort(b,b+Len);
    int minGet=0;
    int i;
    for(i=0;i<Len;++i){
        int pos=lower_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i-1]);
        }
        sort(b,b+Len-i-1);
    }
    minGet=Len-i;
    int maxGiv=0;
    for(i=0;i<Len;++i){
        int pos=upper_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            swap(b[pos],b[Len-i]);
            ++maxGiv;
        }
        /*for(int i=0;i<Len-i;++i)
            printf("%d\t",a[i]);
        printf("\n");*/
        sort(b,b+Len-i-1);
    }
    maxGiv=i;
    printf("%d\n",minGet);
    printf("%d\n",maxGiv);
}


#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAXN=1e3+5;
void Swap(int &a,int &b){
    int temp=a;a=b;b=temp;
}
int main(){
    int  a[MAXN],b[MAXN];
    int Len;scanf("%d",&Len);
    for(int i=0;i<Len;++i){
        char ch;cin>>ch;
        a[i]=ch-'0';
    }
    for(int i=0;i<Len;++i){
        char ch;cin>>ch;
        b[i]=ch-'0';
    }
    sort(b,b+Len);
    int minGet=0;
    int i;
    for(i=0;i<Len;++i){
        int pos=lower_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            Swap(b[pos],b[Len-i-1]);
        }
        sort(b,b+Len-i-1);
    }
    minGet=Len-i;
    int maxGiv=0;
    for(i=0;i<Len;++i){
        int pos=upper_bound(b,b+Len-i,a[i])-b;
        if(pos==Len-i){
            break;
        }
        else{
            Swap(b[pos],b[Len-i]);
            ++maxGiv;
        }
        sort(b,b+Len-i-1);
    }
    maxGiv=i;
    printf("%d\n",minGet);
    printf("%d\n",maxGiv);
}


/* Name: Mohit Khare
B.Tech 2nd Year
Computer Science and Engineering
MNNIT Allahabad
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define ALL(x) x.begin(), x.end()
#define boost ios_base::sync_with_stdio(false);

#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b) for(int i=a;i<b;i++)
#define revr(i,a,b) for(int i=a;i>b;i--)
#define pr1(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<endl;

//const int dx[4]={0,1,0,-1};
//const int dy[4]={1,0,-1,0};
#define linf 99999999999999999ll
#define PI 3.1415926535897932384626
#define mod 1000000007
const int maxn=1e5+1;

int main()
{
	boost
	int n, count1=0, f, count2=0;
    cin >> n;
    f = n - 1;
    string s1, s2, c1, c2;
    cin >> s1 >> s2;
    c1 = s1;
    c2 = s2;
    sort(s1.begin(),s1.end());
    sort(s2.begin(),s2.end());

    for(int i = n - 1; i >= 0; i--)
    {
        if(s1[i] > s2[f])
            count1 ++;
        else
            f--;
    }
    f = 0;
    for(int i = 0; i < n; i++)
  	{
    	if(s2[i] > s1[f])
     	{
     		count2 ++;
     		f++;
     	}
  	}
    cout << count1 << endl;
    cout << count2<< endl;
    return 0;
}


/* Name: Mohit Khare
B.Tech 2nd Year
Computer Science and Engineering
MNNIT Allahabad
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define ALL(x) x.begin(), x.end()
#define boost ios_base::sync_with_stdio(false);

#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b) for(int i=a;i<b;i++)
#define revr(i,a,b) for(int i=a;i>b;i--)
#define pr1(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<endl;

//const int dx[4]={0,1,0,-1};
//const int dy[4]={1,0,-1,0};
#define linf 99999999999999999ll
#define PI 3.1415926535897932384626
#define mod 1000000007
const int maxn=1e5+1;

int main()
{
	boost
	int n;
	cin>>n;
	int a[15],a1[15],cnt=0;
	memset(a,0,sizeof(a));
	memset(a1,0,sizeof(a1));
	char c1[n],c2[n];
	vector<int> v;
	cin>>c1>>c2;
	rep(i,n)
	{
		a[c2[i]-'0']++;
		a1[c2[i]-'0']++;
		v.pb(c2[i]-'0');
	}
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a[x]<=0)
		{
			for(j = x+1;j<10;j++)
			{
				if(a[j]>0)
				{
					a[j]--;
					break;
				}
			}
			if(j==10) cnt++;
		}
		else
		{
			a[x]--;
		}
	}
	int ans = 0;
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a1[x+1]<=0)
		{
			for(j = x+2;j<10;j++)
			{
				if(a1[j]>0)
				{
					a1[j]--;
					ans++;
					break;
				}
			}
		}
		else
		{
			a1[x+1]--;
			ans++;
		}
		//cout<<ans<<endl;
	}
	cout<<cnt<<endl;
	cout<<ans<<endl;
	return 0;
}


/* Name: Mohit Khare
B.Tech 2nd Year
Computer Science and Engineering
MNNIT Allahabad
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define ALL(x) x.begin(), x.end()
#define boost ios_base::sync_with_stdio(false);

#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b) for(int i=a;i<b;i++)
#define revr(i,a,b) for(int i=a;i>b;i--)
#define pr1(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<endl;

//const int dx[4]={0,1,0,-1};
//const int dy[4]={1,0,-1,0};
#define linf 99999999999999999ll
#define PI 3.1415926535897932384626
#define mod 1000000007
const int maxn=1e5+1;

int main()
{
	boost
	int n;
	cin>>n;
	int a[10],cnt=0;
	memset(a,0,sizeof(a));
	char c1[n],c2[n];
	vector<int> v;
	cin>>c1>>c2;
	rep(i,n)
	{
		a[c2[i]-'0']++;
		v.pb(c2[i]-'0');
	}
	sort(v.rbegin(),v.rend());
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a[x]<=0)
		{
			for(j = x;j<10;j++)
			{
				if(a[j]>0)
				{
					a[j]--;
					break;
				}
			}
			if(j==10) cnt++;
		}
	}
	int ans = 0;
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a[x+1]<=0)
		{
			for(j = x+2;j<10;j++)
			{
				if(a[j]>0)
				{
					a[j]--;
					ans++;
				}
			}
		}
		else
		{
			a[x+1]--;
			ans++;
		}
	}
	cout<<cnt<<endl;
	cout<<ans<<endl;
	return 0;
}


/* Name: Mohit Khare
B.Tech 2nd Year
Computer Science and Engineering
MNNIT Allahabad
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define ALL(x) x.begin(), x.end()
#define boost ios_base::sync_with_stdio(false);

#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b) for(int i=a;i<b;i++)
#define revr(i,a,b) for(int i=a;i>b;i--)
#define pr1(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<endl;

//const int dx[4]={0,1,0,-1};
//const int dy[4]={1,0,-1,0};
#define linf 99999999999999999ll
#define PI 3.1415926535897932384626
#define mod 1000000007
const int maxn=1e5+1;

int main()
{
	boost
	int n;
	cin>>n;
	int a[10],a1[10],cnt=0;
	memset(a,0,sizeof(a));
	memset(a1,0,sizeof(a1));
	char c1[n],c2[n];
	vector<int> v;
	cin>>c1>>c2;
	rep(i,n)
	{
		a[c2[i]-'0']++;
		a1[c2[i]-'0']++;
		v.pb(c2[i]-'0');
	}
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a[x]<=0)
		{
			for(j = x+1;j<10;j++)
			{
				if(a[j]>0)
				{
					a[j]--;
					break;
				}
			}
			if(j==10) cnt++;
		}
		else
		{
			a[x]--;
		}
	}
	int ans = 0;
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a1[x+1]<=0)
		{
			for(j = x+2;j<10;j++)
			{
				if(a1[j]>0)
				{
					a1[j]--;
					ans++;
				}
			}
		}
		else
		{
			a1[x+1]--;
			ans++;
		}
	}
	cout<<cnt<<endl;
	cout<<ans<<endl;
	return 0;
}


/* Name: Mohit Khare
B.Tech 2nd Year
Computer Science and Engineering
MNNIT Allahabad
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define ALL(x) x.begin(), x.end()
#define boost ios_base::sync_with_stdio(false);

#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b) for(int i=a;i<b;i++)
#define revr(i,a,b) for(int i=a;i>b;i--)
#define pr1(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<endl;

//const int dx[4]={0,1,0,-1};
//const int dy[4]={1,0,-1,0};
#define linf 99999999999999999ll
#define PI 3.1415926535897932384626
#define mod 1000000007
const int maxn=1e5+1;

int main()
{
	boost
	int n;
	cin>>n;
	int a[15],a1[15],cnt=0;
	memset(a,0,sizeof(a));
	memset(a1,0,sizeof(a1));
	char c1[n],c2[n];
	vector<int> v;
	cin>>c1>>c2;
	rep(i,n)
	{
		a[c2[i]-'0']++;
		a1[c2[i]-'0']++;
		v.pb(c2[i]-'0');
	}
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a[x]<=0)
		{
			for(j = x+1;j<10;j++)
			{
				if(a[j]>0)
				{
					a[j]--;
					break;
				}
			}
			if(j==10) cnt++;
		}
		else
		{
			a[x]--;
		}
	}
	int ans = 0;
	rep(i,n)
	{
		int j;
		int x = c1[i]-'0';
		if(a1[x+1]<=0)
		{
			for(j = x+2;j<10;j++)
			{
				if(a1[j]>0)
				{
					a1[j]--;
					ans++;
				}
			}
		}
		else
		{
			a1[x+1]--;
			ans++;
		}
	}
	cout<<cnt<<endl;
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1050;
int vis[maxn];
int link[maxn],linkk[maxn];
int mp[maxn][maxn];
int k,n,m;
int dfs(int x)
{
    for(int i=0; i<n; i++)
    {
        if(!vis[i]&&mp[x][i])
        {
            vis[i]=1;
            if(!link[i]||dfs(link[i]))
            {
                link[i]=x;
                linkk[x]=i;
                return true;
            }
        }
    }
    return false;
}
int xyl()
{
    int ans=0;
    memset(link,0,sizeof(link));
    memset(linkk,0,sizeof(linkk));
    for(int i=0; i<n; i++)
    {
        if(linkk[i]==0)
        {
            memset(vis,0,sizeof(vis));
            if(dfs(i)) ans++;
        }
    }
    return ans;
}
int vv[maxn];
int main()
{
    char s1[10000],s2[10000];
    cin>>n;
    cin>>s1>>s2;
    int cnt=0;
    memset(vv,0,sizeof(vv));
    memset(mp,0,sizeof(mp));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if((s1[i])<(s2[j]))
            {
               mp[i][j]=1;
               vv[j]=1;
            }

        }
    }
    int ans1=xyl();
      for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if((s1[i])<=(s2[j])&&mp[i][j]==0)
            {
               mp[i][j]=1;
               vv[j]=1;
            }

        }
    }
    int ans2=xyl();
    printf("%d\n%d\n",n-ans2,ans1);
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x;
    char s1[1005],s2[1005];
    cin>>n>>s1>>s2;
    sort(s1,s1+n);
    sort(s2,s2+n);
    int j=n-1;
    for(int i=n-1;i>=0;i--)
        if(s2[j]>=s1[i])
        j--;
    cout<<j+1<<endl;
    j=0;
    for(int i=0;i<n;i++)
    {
        if(s2[i]>s1[j])
            j++;
    }
    cout<<j<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1050;
int vis[maxn];
int link[maxn],linkk[maxn];
int mp[maxn][maxn];
int k,n,m;
int dfs(int x)
{
    for(int i=0; i<n; i++)
    {
        if(!vis[i]&&mp[x][i])
        {
            vis[i]=1;
            if(!link[i]||dfs(link[i]))
            {
                link[i]=x;
                linkk[x]=i;
                return true;
            }
        }
    }
    return false;
}
int xyl()
{
    int ans=0;
    memset(link,0,sizeof(link));
    memset(linkk,0,sizeof(linkk));
    for(int i=0; i<n; i++)
    {
        if(linkk[i]==0)
        {
            memset(vis,0,sizeof(vis));
            if(dfs(i)) ans++;
        }
    }
    return ans;
}

int main()
{
    char s1[10000],s2[10000];
    cin>>n;
    cin>>s1>>s2;
    memset(mp,0,sizeof(mp));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if((s1[i]-'0')<(s2[j]-'0'))
            mp[i][j]=1;
        }
    }
    int ans1=xyl();
    memset(mp,0,sizeof(mp));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if((s1[i]-'0')<=(s2[j]-'0'))
            mp[i][j]=1;
        }
    }
    int ans2=xyl();
    printf("%d\n%d\n",n-ans2,ans1);
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1050;
int vis[maxn];
int link[maxn],linkk[maxn];
int mp[maxn][maxn];
int k,n,m;
int dfs(int x)
{
    for(int i=0; i<n; i++)
    {
        if(!vis[i]&&mp[x][i])
        {
            vis[i]=1;
            if(!link[i]||dfs(link[i]))
            {
                link[i]=x;
                linkk[x]=i;
                return true;
            }
        }
    }
    return false;
}
int xyl()
{
    int ans=0;
    memset(link,0,sizeof(link));
    memset(linkk,0,sizeof(linkk));
    for(int i=0; i<n; i++)
    {
        if(linkk[i]==0)
        {
            memset(vis,0,sizeof(vis));
            if(dfs(i)) ans++;
        }
    }
    return ans;
}
int vv[maxn];
int main()
{
    char s1[10000],s2[10000];
    cin>>n;
    cin>>s1>>s2;
    int cnt=0;
    memset(vv,0,sizeof(vv));
    memset(mp,0,sizeof(mp));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if((s1[i])<(s2[j]))
            {
               mp[i][j]=1;
               vv[j]=1;
            }

        }
    }
    for(int i=0;i<n;i++)
    {
        if(vv[i]==0)
        {
            for(int j=0;j<n;j++)
            {
                if(s1[j]==s2[i])
                {
                    cnt++;
                    break;
                }
            }
        }
    }
    int ans1=xyl();
    printf("%d\n%d\n",n-ans1-cnt,ans1);
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,a[1010],b[1010],ans;
void get(int *s){
	char c;
	for (int i=1;i<=n;i++){
		char c=getchar();
		while (c<'0'||c>'9') c=getchar();
		s[i]=c-'0';
	}
}
int main()
{
	scanf("%d",&n);
	get(a);get(b);
	sort(b+1,b+n+1);
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<a[i]) ++ptr;
		if (ptr>n) ++ans;
	}
	printf("%d\n",ans);ans=0;
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<=a[i]) ++ptr;
		if (ptr<=n) ++ans;
	}
	printf("%d\n",ans);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,a[1010],b[1010],ans;
void get(int *s){
	char c;
	for (int i=1;i<=n;i++){
/*		char c=getchar();
		while (c<'0'||c>'9') c=getchar();
		s[i]=c-'0';*/
		scanf("%d",&s);
	}
}
int main()
{
	scanf("%d",&n);
	get(a);get(b);
	sort(b+1,b+n+1);
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<a[i]) ++ptr;
		if (ptr>n) ++ans;
	}
	printf("%d\n",ans);ans=0;
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<=a[i]) ++ptr;
		if (ptr<=n) ++ans;
	}
	printf("%d\n",ans);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,a[1010],b[1010],ans;
void get(int *s){
	char c;
	for (int i=1;i<=n;i++){
		char c=getchar();
		while (c<'0'||c>'9') c=getchar();
		s[i]=c-'0';
	}
}
int main()
{
	scanf("%d",&n);
	get(a);get(b);
	sort(a+1,a+n+1);
	sort(b+1,b+n+1);
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<a[i]) ++ptr;
		if (ptr>n) ++ans;
		++ptr;
	}
	printf("%d\n",ans);ans=0;
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<=a[i]) ++ptr;
		if (ptr<=n) ++ans;
		++ptr;
	}
	printf("%d\n",ans);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,a[1010],b[1010],ans;
void get(int *s){
	char c;
	for (int i=1;i<=n;i++){
		char c=getchar();
		while (c<'0'||c>'9') c=getchar();
		s[i]=c-'0';
	}
}
int main()
{
	scanf("%d",&n);
	get(a);get(b);
	sort(a+1,a+n+1);
	sort(b+1,b+n+1);
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<a[i]) ++ptr;
		if (ptr>n) ++ans;
	}
	printf("%d\n",ans);ans=0;
	for (int i=1,ptr=1;i<=n;i++){
		while (ptr<=n&&b[ptr]<=a[i]) ++ptr;
		if (ptr<=n) ++ans;
	}
	printf("%d\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

string a, b;
int q='0', n, pr, x[100], y[100], mn, mx;

int main(){
//	freopen("D.in", "r", stdin);
//	freopen("D.out", "w", stdout);
	cin >> n;
	cin >> a >> b;
	for (int i=0; i<n; i++){
		x[a[i]-q]++;
		y[b[i]-q]++;
	}
	for (int i=1; i<10; i++){
		pr=0;
		if (y[i]){
			for (int l=i-1; l>=0; l--){
				if (!pr && x[l]) mx++, pr=1;
			}
		}
	}
	for (int i=0; i<10; i++){
		pr=1;
		if (x[i]){
			for (int l=i; l<10; l++){
				if (y[l]) pr=0;
			}
			if (pr) mn+=x[i];
		}
	}
	cout << mn << endl << mx;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

string a, b;
int q='0', n, pr, x[100], y[100], mn, mx;

int main(){
//	freopen("D.in", "r", stdin);
//	freopen("D.out", "w", stdout);
	cin >> n;
	cin >> a >> b;
	for (int i=0; i<n; i++){
		x[a[i]-q]++;
		y[b[i]-q]++;
	}
	for (int i=0; i<10; i++){
		pr=0;
		if (y[i]){
			for (int l=i-1; l>=0; l--){
				if (!pr && x[l]) mx++, pr=1;
			}
		}
	}
	for (int i=9; i>=0; i--){
		if (x[i]){
			for (int l=i; l<10; l++){
				if (y[l]) x[i]--, y[l]--;
			}
//			cerr << x[i] << ' ' << i << endl;
			mn+=x[i];
		}
	}
	cout << mn << endl << mx;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

string a, b;
int q='0', n, pr, x[100], y[100], mn, mx;

int main(){
//	freopen("D.in", "r", stdin);
//	freopen("D.out", "w", stdout);
	cin >> n;
	cin >> a >> b;
	for (int i=0; i<n; i++){
		x[a[i]-q]++;
		y[b[i]-q]++;
	}
	for (int i=0; i<10; i++){
		pr=0;
		if (y[i]){
			for (int l=i-1; l>=0; l--){
				if (!pr && x[l]) mx++, pr=1;
			}
		}
	}
	for (int i=9; i>=0; i--){
		if (x[i]){
			for (int l=9; l>=i; l--){
				if (y[l]) x[i]--, y[l]--;
			}
//			cerr << x[i] << ' ' << i << endl;
			mn+=x[i];
		}
	}
	cout << mn << endl << mx;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

string a, b;
int q='0', n, pr, x[100], y[100], mn, mx, c[105];

int main(){
//	freopen("D.in", "r", stdin);
//	freopen("D.out", "w", stdout);
	cin >> n;
	cin >> a >> b;
	mn=n;
	for (int i=0; i<n; i++){
		x[a[i]-q]++;
		y[b[i]-q]++;
		c[b[i]-q]++;
	}
	for (int i=0; i<10; i++){
		if (x[i]){
			for (int l=i+1; l<10; l++){
				if (y[l]){
					y[l]--;
					mx++;
					break;
				}
			}
		}
	}
	for (int i=0; i<10; i++){
		if (x[i]){
			for (int l=i; l<10; l++){
				if (c[l]){
					c[l]--;
					mn--;
					break;
				}
			}
		}
	}
	cout << mn << endl << mx;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

string a, b;
int q='0', n, pr, x[100], y[100], mn, mx;

int main(){
//	freopen("D.in", "r", stdin);
//	freopen("D.out", "w", stdout);
	cin >> n;
	cin >> a >> b;
	for (int i=0; i<n; i++){
		x[a[i]-q]++;
		y[b[i]-q]++;
	}
	for (int i=0; i<10; i++){
		pr=0;
		if (y[i]){
			for (int l=i-1; l>=0; l--){
				if (!pr && x[l]) mx++, pr=1;
			}
		}
	}
	for (int i=9; i>=0; i--){
		if (x[i]){
			for (int l=9; l>=i; l--){
				if (y[l]) x[i]--, y[l]--;
				if (x[i]==0) break;
			}
//			cerr << x[i] << ' ' << i << endl;
			mn+=x[i];
		}
	}
	cout << mn << endl << mx;
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <map>

using namespace std;

const int inf = 0x3f3f3f3f;
const int Max = 1100;
typedef long long int LL;

int main()
{
    int m,  j, u, v, n, i, a, b;
    int s1[5], s2[5];
    while(cin>>n)
    {
        cin>>a>>b;
        if(n == 1)
        {
            if(a>b)
                printf("1\n0\n");
            else if(b > a)
                printf("0\n1\n");
            else
                printf("0\n0\n");
            continue;
        }
        for(i = 0; i < n; i++)
        {
            s1[i] = a%10;
            //printf("%d ", s1[i]);
            a/=10;
            s2[i] = b%10;
            //printf("%d ", s2[i]);
            b/=10;
        }
        sort(s1, s1+n);
        sort(s2, s2+n);
        int Max2 = 0;int Max1 = 0;
        int vis[Max];
        memset(vis, 0, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] < s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    Max2++;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        memset(vis, 0, sizeof(vis));
         for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] <= s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        Max1++;
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        printf("%d\n%d\n",Max1,Max2);
    }
    return 0;
}
/*

 */


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <map>

using namespace std;

const int inf = 0x3f3f3f3f;
const int maxx = 1100;
typedef long long int LL;

int main()
{
    int m,  j, u, v, n, i, a, b;
    int s1[maxx], s2[maxx];
    while(cin>>n)
    {
        cin>>a>>b;
        for(i = 0; i < n; i++)
        {
            s1[i] = a%10;
            //printf("%d ", s1[i]);
            a/=10;
            s2[i] = b%10;
            //printf("%d ", s2[i]);
            b/=10;
        }
        sort(s2, s2+n);
        int maxx2 = 0;int maxx1 = 0;
        int vis[maxx];
        memset(vis, 0, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] < s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    maxx2++;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        memset(vis, 0, sizeof(vis));
         for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] <= s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        maxx1++;
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        printf("%d\n%d\n",maxx1,maxx2);
    }
    return 0;
}
/*

 */


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <map>

using namespace std;

const int inf = 0x3f3f3f3f;
const int maxx = 1100;
typedef long long int LL;

int main()
{
    int m,  j, u, v, n, i;
    char a[maxx], b[maxx];
    int s1[maxx], s2[maxx];
    while(cin>>n)
    {
        cin>>a>>b;
        for(i = 0; i < n; i++)
        {
            s1[i] = a[i]-'a';
            //printf("%d ", s1[i]);
            s2[i] = b[i] - 'a';
            //printf("%d ", s2[i]);
        }
        sort(s2, s2+n);
        int maxx2 = 0;int maxx1 = 0;
        int vis[maxx];
        memset(vis, 0, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] < s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    maxx2++;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        memset(vis, 0, sizeof(vis));
         for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] <= s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        maxx1++;
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        printf("%d\n%d\n",maxx1,maxx2);
    }
    return 0;
}
/*

 */


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <map>

using namespace std;

const int inf = 0x3f3f3f3f;
const int Max = 1100;
typedef long long int LL;

int main()
{
    int m,  j, u, v, n, i, a, b;
    int s1[Max], s2[Max];
    while(cin>>n)
    {
        cin>>a>>b;
        if(n == 1)
        {
            if(a>b)
                printf("1\n0\n");
            else if(b > a)
                printf("0\n1\n");
            else
                printf("0\n0\n");
            continue;
        }
        for(i = 0; i < n; i++)
        {
            s1[i] = a%10;
            //printf("%d ", s1[i]);
            a/=10;
            s2[i] = b%10;
            //printf("%d ", s2[i]);
            b/=10;
        }
        sort(s1, s1+n);
        sort(s2, s2+n);
        int Max2 = 0;int Max1 = 0;
        int vis[Max];
        memset(vis, 0, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] < s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    Max2++;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        memset(vis, 0, sizeof(vis));
         for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] <= s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        Max1++;
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        printf("%d\n%d\n",Max1,Max2);
    }
    return 0;
}
/*

 */


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <map>

using namespace std;

const int inf = 0x3f3f3f3f;
const int Max = 10;
typedef long long int LL;

int main()
{
    int m,  j, u, v, n, i, a, b;
    int s1[5], s2[5];
    while(cin>>n)
    {
        cin>>a>>b;
        if(n == 1)
        {
            if(a>b)
                printf("1\n0\n");
            else if(b > a)
                printf("0\n1\n");
            else
                printf("0\n0\n");
            continue;
        }
        for(i = 0; i < n; i++)
        {
            s1[i] = a%10;
            //printf("%d ", s1[i]);
            a/=10;
            s2[i] = b%10;
            //printf("%d ", s2[i]);
            b/=10;
        }
        sort(s1, s1+n);
        sort(s2, s2+n);
        int Max2 = 0;int Max1 = 0;
        int vis[Max];
        memset(vis, 0, sizeof(vis));
        for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] < s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    Max2++;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        memset(vis, 0, sizeof(vis));
         for(i = 0; i < n; i++)
        {
            int flag = 0;
            for( j = 0; j < n; j++)
            {
                if(s1[i] <= s2[j] && !vis[j])
                {
                    vis[j] = 1;
                    flag = 1;
                    break;
                }
            }
            if(!flag)
            {
                for( j = 0; j < n; j++)
                {
                    if(!vis[j])
                    {
                        Max1++;
                        vis[j] = 1;
                        break;
                    }
                }
            }
        }
        printf("%d\n%d\n",Max1,Max2);
    }
    return 0;
}
/*

 */


#include <bits/stdc++.h>

#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>=y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

int main() {
	int n;
	string cad1,cad2,t1,t2;
	scanf("%d",&n);
	cin.ignore();
	getline(cin,cad1);
	getline(cin,cad2);
	t1=cad1;t2=cad2;
	sort(all(t1));
	sort(all(t2));
	int cm=0;
	REP(i,n)
		if(t1[i]>t2[i])
			cm++;

	int cs=0,freq1[10]={0},freq2[10]={0};
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;
	REP(i,10)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,cs++;
					i--;
					break;
				}
			}
		}
	}
	printf("%d\n%d\n",cm,cs);
	return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>=y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

int main() {
	int n;
	string cad1,cad2,t1,t2;
	scanf("%d",&n);
	cin.ignore();
	getline(cin,cad1);
	getline(cin,cad2);
	int cm=n,cs=0,freq1[10]={0},freq2[10]={0};
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;

	REP(i,10)
	{
		if(freq2[i] && freq1[i])
		{
			freq2[i]--;
			freq1[i]--;
			i--;
			cm--;
		}
	}

	t1="";
	REP(i,10)
		if(freq1[i])
			t1+=(i+'0'),freq1[i]--,i--;
	reverse(all(t1));
	t2="";
	REP(i,10)
		if(freq2[i])
			t2+=(i+'0'),freq2[i]--,i--;
	REP(i,cm)
		if(t1[i]<t2[i])
			cm--;

	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;

	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,cs++;
					i++;
					break;
				}
			}
		}
	}
	printf("%d\n%d\n",cm,cs);
	return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>=y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

int main() {
	int n;
	string cad1,cad2,t1,t2;
	scanf("%d",&n);
	cin.ignore();
	getline(cin,cad1);
	getline(cin,cad2);
	int cm=n,cs=0,freq1[10]={0},freq2[10]={0};
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;
	REP(i,10)
	{
		if(freq2[i] && freq1[i])
		{
			freq2[i]--;
			freq1[i]--;
			cm--;
		}
	}
	t1="";
	REP(i,10)
		if(freq1[i])
			t1+=(i+'0');
	reverse(all(t1));
	t2="";
	REP(i,10)
		if(freq2[i])
			t2+=(i+'0');
	REP(i,cm)
		if(t1[i]<t2[i])
			cm--;

	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;
	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,cs++;
					i++;
					break;
				}
			}
		}
	}
	printf("%d\n%d\n",cm,cs);
	return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>=y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

int main() {
	int n;
	string cad1,cad2,t1,t2;
	scanf("%d",&n);
	cin.ignore();
	getline(cin,cad1);
	getline(cin,cad2);
	int cm=n,cs=0,freq1[10]={0},freq2[10]={0};
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;
	REP(i,10)
	{
		if(freq2[i] && freq1[i])
		{
			freq2[i]--;
			freq1[i]--;
			i--;
			cm--;
		}
	}
	int c=0;
	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,c++;
					i++;
					break;
				}
			}
		}
	}
	cm-=c;
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;

	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,cs++;
					i++;
					break;
				}
			}
		}
	}
	printf("%d\n%d\n",cm,cs);
	return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>=y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

int main() {
	int n;
	string cad1,cad2,t1,t2;
	scanf("%d",&n);
	cin.ignore();
	getline(cin,cad1);
	getline(cin,cad2);
	int cm=n,cs=0,freq1[10]={0},freq2[10]={0};
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;

	REP(i,10)
	{
		if(freq2[i] && freq1[i])
		{
			freq2[i]--;
			freq1[i]--;
			i--;
			cm--;
		}
	}

	t1="";
	REP(i,10)
		if(freq1[i])
			t1+=(i+'0'),freq1[i]--,i--;
	reverse(all(t1));
	t2="";
	REP(i,10)
		if(freq2[i])
			t2+=(i+'0'),freq2[i]--,i--;
	int c=0;
	REP(i,cm)
		if(t1[i]<t2[i])
			c++;
	cm-=c;
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;

	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,cs++;
					i++;
					break;
				}
			}
		}
	}
	printf("%d\n%d\n",cm,cs);
	return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>=y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

int main() {
	int n;
	string cad1,cad2,t1,t2;
	scanf("%d",&n);
	cin.ignore();
	getline(cin,cad1);
	getline(cin,cad2);
	int cm=n,cs=0,freq1[10]={0},freq2[10]={0};
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;
	REP(i,10)
	{
		if(freq2[i] && freq1[i])
		{
			freq2[i]--;
			freq1[i]--;
			i--;
			cm--;
		}
	}
	int c=0;
	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,c++;
					i++;
					break;
				}
			}
		}
	}
	cm-=c;
	mset(freq1,0);
	mset(freq2,0);;
	REP(i,n)
		freq1[cad1[i]-'0']++,freq2[cad2[i]-'0']++;
	RFOR(i,9,0)
	{
		if(freq1[i])
		{
			FOR(j,i+1,10)
			{
				if(freq2[j])
				{
					freq1[i]--,freq2[j]--,cs++;
					i++;
					break;
				}
			}
		}
	}
	printf("%d\n%d\n",cm,cs);
	return 0;
}