#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <vector>
#include <queue>

#define unless(c) if (!(c))
#define each(i, c) for (auto& i: c)

using namespace std;

const int inf = 1 << 29;
struct edge { int to, cap, cost, rev; };

const int MAX_V = ('z' - 'a') * 2 + 10;

int V = MAX_V;
vector<edge> g[MAX_V];
int h[MAX_V];
int dist[MAX_V];
int prevv[MAX_V], preve[MAX_V];

void add_edge(int from, int to, int cap, int cost)
{
  // cout << from << ' ' << to << endl;
  g[from].push_back((edge){to, cap, cost, g[to].size()});
  g[to].push_back((edge){from, 0, -cost, g[from].size() - 1});
}

typedef pair<int, int> P;

int min_cost_flow(int s, int t, int f)
{
  // cout << "st : " << s << " => " << t << endl;
  int res = 0;
  while(f > 0){
    fill(dist, dist + V, inf);
    dist[s] = 0;
    while (true) {
      bool flg = false;
      for (int v = 0; v < V; v++) {
        if (dist[v] == inf) continue;
        for (int i = 0; i < g[v].size(); i++) {
          edge &e = g[v][i];
          if (e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
            dist[e.to] = dist[v] + e.cost;
	    prevv[e.to] = v;
	    preve[e.to] = i;
	    flg = true;
          }
        }
      }
      if (!flg) break;
    }    
    // cout << __LINE__ << ": " << dist[t] << endl;
    if(dist[t] == inf){
      return res;
    }
    int d = f;
    for (int v = t; v != s; v = prevv[v]) {
      // cout << v << endl;
      d = min(d, g[prevv[v]][preve[v]].cap);
    }
    // cout << __LINE__ << ": " << endl;
    f -= d;
    res += d * dist[t];
    // cout << __LINE__ << ": " << endl;
    for (int v = t; v != s; v = prevv[v]) {
      edge &e = g[prevv[v]][preve[v]];
      e.cap -= d;
      g[v][e.rev].cap += d;
    }
    // cout << __LINE__ << ": " << endl;
  }
  return res;

  /*
    int res = 0;
    fill(h, h + V, inf);
    h[s] = 0;
    for (int loop = V; loop--; ) {
    for (int i = 0; i < V; ++i) {
    if (h[i] == inf) continue;
    for (int j = 0; j < g[i].size(); ++j) {
    edge& e = g[i][j];
    if (e.cap) {
    h[e.to] = min(h[e.to], h[i] + e.cost);
    }
    }
    }
    }
    for (int i = 0; i < V; ++i) {
    if (h[i] != inf) cout << i << ": " << h[i] << endl;
    }
    while (f > 0) {
    priority_queue<P, vector<P>, greater<P> > q;
    fill(dist, dist + V, inf);
    dist[s] = 0;
    q.push(P(0, s));
    while (q.size()) {
    const P p = q.top();
    q.pop();
    const int v = p.second;
    if (dist[v] < p.first) continue;
    for (int i = 0; i < g[v].size(); ++i) {
    const edge& e = g[v][i];
    if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]) {
    dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
    prevv[e.to] = v;
    preve[e.to] = i;
    q.push(P(dist[e.to], e.to));
    }
    }
    }
    if (dist[t] >= inf) {
    return res;
    }
    for (int v = 0; v < V; ++v) {
    h[v] += dist[v];
    }
    int d = f;
    for (int v = t; v != s; v = prevv[v]) {
    d = min(d, g[prevv[v]][preve[v]].cap);
    }
    f -= d;
    res += d * h[t];
    for (int v = t; v != s; v = prevv[v]) {
    edge& e = g[prevv[v]][preve[v]];
    e.cap -= d;
    g[v][e.rev].cap += d;
    }
    }
    return res;
  */
}

int main(void)
{
  int n;
  while (cin >> n) {
    fill(g, g + V, vector<edge>());
    string s;
    string t;
    cin >> s >> t;
    int cnt_s[300];
    int cnt_t[300];
    set<char> cs(s.begin(), s.end());
    fill(cnt_s, cnt_s + 300, 0);
    fill(cnt_t, cnt_t + 300, 0);
    for (char c = 'a'; c <= 'z'; ++c) {
      cnt_s[c] = count(s.begin(), s.end(), c);
      cnt_t[c] = count(t.begin(), t.end(), c);
    }
    const int source = V - 1;
    const int sink = V - 2;
    const int base = V / 2;
    for (char c = 'a'; c <= 'z'; ++c) {
      for (char d = 'a'; d <= 'z'; ++d) {
	if (cnt_s[c] && cnt_t[d]) {
	  int a = c - 'a';
	  int b = d - 'a' + base;
	  add_edge(a, b, 1, -min(cnt_s[c], cnt_t[d]));
	}
      }
    }
    for (char c = 'a'; c <= 'z'; ++c) {
      if (cnt_s[c]) {
	add_edge(source, c - 'a', 1, 0);
	int n = c - 'a';
	// g[source].push_back((edge){n, 1, 0});
      }
      if (cnt_t[c]) {
	add_edge(c - 'a' + base, sink, 1, 0);
	int n = c - 'a' + base;
	// g[n].push_back((edge){sink, 1, 0});
      }
    }
    int tmp = min_cost_flow(source, sink, cs.size());
    // cout << "tmp: " << tmp << endl;
    cout << n + tmp << endl;
  }
  return 0;
}

Measured memory_bytes: 1532