#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("0"); return 0;}
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{for(T&x:v)i>>x;return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;for(T&x:v)s<<' '<<x;return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}

const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;

vvi e[20];

int main() {
  int n;
  string s;
  cin >> n >> s;
  vi a(26);
  rep(i,n) if (i%2==0) a[s[i]-'a']++;
  int ans = n;
  e[0].pb(vi());
  rep(i,9) {
    for (vi ne : e[i]) {
      int j = 1;
      if (sz(ne)) j = ne.back();
      for (;j<=9;++j) {
        vi me = ne; me.pb(j);
        e[i+j].pb(me);
      }
    }
  }
  rep(i,1<<10) if ((i&3) == 3) {
    int now = -9;
    vi b(10);
    rep(j,10) b[j] = i>>j&1;
    rep(j,10) if (b[j]) now += 4;
    // if (i == 47) cout<<now<<endl;
    vi s(10);
    bool ok = true;
    rep(c,26) {
      int x = a[c], z = INF;
      for (vi ne : e[x]) {
        int nz = 0;
        for (int j : ne) {
          if (!b[j]) {
            if (j == 1) nz += 2; else nz += 4;
          } else {
            nz += 2;
          }
        }
        mins(z,nz);
      }
      if (z == INF) ok = false;
      now += z;
      // if (i == 47) cout<<c<<" "<<z<<endl;
    }
    // if (i == 47) cout<<i<<" "<<now<<endl;
    // rep(j,10) if (b[j] && !s[j]) ok = false;
    if (ok) mins(ans, now);
  }
  cout<<ans<<endl;
  return 0;
}