using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

// (づ°ω°)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public object Solve()
    {
        int n = ReadInt();
        int k = ReadInt();

        var a = new int[n];
        int l = 1, r = n;
        int i;
        for (i = 0; i < n && k > 0; i++, k--)
        {
            if (i % 2 == 0)
                a[i] = l++;
            else
                a[i] = r--;
        }
        if (i % 2 == 1)
            for (; i < n; i++)
                a[i] = a[i - 1] + 1;
        else
            for (; i < n; i++)
                a[i] = a[i - 1] - 1;

        Write(a);

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        //reader = new StreamReader(Console.OpenStandardInput());
        //writer = new StreamWriter(Console.OpenStandardOutput());
        reader = new StreamReader("exchange.in");
        writer = new StreamWriter("exchange.out");
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            Console.WriteLine(ex);
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
public class Solver
{
    #region Main
    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        var n = ReadInt();
        var k = ReadInt();
        int a = 1;
        int b = k + 1;
        bool flip = false;
        for (int i = 0; i <= k; i++)
        {
            if (flip = !flip)
            {
                Console.Write(a++ + " ");
            }
            else
            {
                Console.Write(b-- + " ");
            }
        }
        a = k + 2;
        for (int i = 0; i < n - k-1; i++)
        {
            Console.Write(a++ + " ");
        }
        reader.Close();
        writer.Close();
    }
    #endregion
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c || (x.c == y.c && x.r < y.r))
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string GetString()
		{
			return Console.ReadLine();
		}

		public static List<int> getList()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

		public static int getInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		public class Vertex
		{
			public List<int> edges;

			public int ct;

			public Vertex()
			{
				ct = 0;
				edges = new List<int>();
				for (var i = 0; i < 26; ++i)
					edges.Add(0);
			}
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/
			var l = getList();
			var n = l[0];
			var k = l[1];
			var ans = new List<int>();
			var ll = 1;
			var rr = n;
			for (var i = 1; i <= k; ++i)
			{
				if (i % 2 == 1)
				{
					Console.Write("{0} ", ll);
					ll++;
				}
				else
				{
					Console.Write("{0} ", rr);
					rr--;
				}
			}
			if (k % 2 == 1)
			{
				for (var i = ll; i <= rr; ++i)
					Console.Write("{0} ", i);
			}
			else
			{
				for (var i = rr; i >= ll; --i)
					Console.Write("{0} ", i);
			}
			/*			input.Close();
			output.Close();*/
		}
	}
}


fun main() {
    var (n, k) = readLine()!!.split(" ").map(String::toInt)
    var multiplier = 1
    val sol = ArrayList<Int>(n)
    sol.add(1)
    var diff = n - 1
    while (k > 1) {
        sol.add(sol.last() + multiplier * diff--)
        multiplier = -multiplier
        k--
    }
    for (i in 1 .. n - sol.size)
        sol.add(sol.last() + multiplier)
    print(sol.joinToString(" "))
}


#include <bits/stdc++.h>

#ifdef PEYEK
    #define debugln {printf("----OK----\n");}
    #define debug(...) {printf(__VA_ARGS__);}
    #define debugs(...) {printf(":::::--->> ");printf(__VA_ARGS__);}
    #define TIME() printf("%.3lf\n",clock()/(double)CLOCKS_PER_SEC)
#else
    #define debugln {}
    #define debug(...) {}
    #define debugs(...) {}
    #define TIME() {}
#endif

#define __INIT_CC__ ios::sync_with_stdio(false); \
    cin.tie(0);

#ifdef __WIN32__
    char getchar_unlocked() {return getchar();}
#endif

#define FOR(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<(_t);++(_i))
#define FORN(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<=(_t);++(_i))
#define FORD(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i>=(_t);--(_i))
#define FORLL(_i,_n,_m) for(long long (_i)=(_n),_t=(_m);_i<(_t);++(_i))
#define FORNLL(_i,_n,_m) for(long long (_i)=(_n),_t=(_m);(_i)<=(_t);++(_i))
#define FORDLL(_i,_n,_m) for(long long (_i)=(_n),_t=(_m);(_i)>=(_t);--(_i))
#define FOREACH(_i,_a) for (__typeof(_a.begin()) _i=_a.begin();_i!=_a.end();++_i)
#define RESET(_a,_value) memset(_a,_value,sizeof(_a))
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ff first
#define ss second
#define mp make_pair
#define SIZE(_a) (int)_a.size()
#define VSORT(_a) sort(_a.begin(),_a.end())
#define SSORT(_a,_val) sort(_a,_a+(_val))
#define ALL(_a) _a.begin(),_a.end()

using namespace std;

const int dr[]={ 1, 0,-1, 0, 1, 1,-1,-1};
const int dc[]={ 0, 1, 0,-1, 1,-1,-1, 1};
const double eps=1e-9;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;
typedef pair<double,double> pdd;
typedef vector<pdd> vpdd;
const int INF=0x7FFFFFFF;
const ll INFLL=0x7FFFFFFFFFFFFFFFLL;
const double pi=acos(-1);

template <class T> T take(queue<T> &O) {T tmp=O.front();O.pop();return tmp;}
template <class T> T take(stack<T> &O) {T tmp=O.top();O.pop();return tmp;}
template <class T> T take(priority_queue<T> &O) {T tmp=O.top();O.pop();return tmp;}
template <class T> inline void getint(T &num)
{
    bool neg=0;
    num=0;
    char c;
    while ((c=getchar_unlocked()) && (!isdigit(c) && c!='-'));
    if (c=='-')
    {
        neg=1;
        c=getchar_unlocked();
    }
    do num=num*10+c-'0';
    while ((c=getchar_unlocked()) && isdigit(c));
    num*=(neg)?-1:1;
}

template <class T> inline bool inRange(T z, T a, T b){return a <= z && z <= b;}

void OPEN(string in="input.txt",string out="output.txt")
{
    freopen(in.c_str(),"r",stdin);
    freopen(out.c_str(),"w",stdout);
    return ;
}

//using sokokaleb's template v3.0

int n,k;
int u,b;

int main()
{
    __INIT_CC__;
    cin >> n >> k;
    u = n - 1;
    b = 1;
    cout << n;
    FOR (i,0,k - 1)
    {
        if (i&1) cout << " " << (u--);
        else cout << " " << (b++);
    }

    --k;

    if (k&1)
    {
        while (u >= b)
            cout << " " << (b++);
    }
    else
    {
        while (u >= b)
            cout << " " << (u--);
    }
    cout << endl;
}


#include <bits/stdc++.h>

#ifdef PEYEK
	#define debugln {printf("----OK----\n");}
	#define debug(...) {printf(__VA_ARGS__);}
	#define debugs(...) {printf(":::::--->> ");printf(__VA_ARGS__);}
	#define TIME() printf("%.3lf\n",clock()/(double)CLOCKS_PER_SEC)
#else
	#define debugln {}
	#define debug(...) {}
	#define debugs(...) {}
	#define TIME() {}
#endif

#define __INIT_CC__ ios::sync_with_stdio(false); \
	cin.tie(0);

#ifdef __WIN32__
	char getchar_unlocked() {return getchar();}
#endif

#define FOR(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<(_t);++(_i))
#define FORN(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<=(_t);++(_i))
#define FORD(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i>=(_t);--(_i))
#define FORLL(_i,_n,_m) for(long long (_i)=(_n),_t=(_m);_i<(_t);++(_i))
#define FORNLL(_i,_n,_m) for(long long (_i)=(_n),_t=(_m);(_i)<=(_t);++(_i))
#define FORDLL(_i,_n,_m) for(long long (_i)=(_n),_t=(_m);(_i)>=(_t);--(_i))
#define FOREACH(_i,_a) for (__typeof(_a.begin()) _i=_a.begin();_i!=_a.end();++_i)
#define RESET(_a,_value) memset(_a,_value,sizeof(_a))
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ff first
#define ss second
#define mp make_pair
#define SIZE(_a) (int)_a.size()
#define VSORT(_a) sort(_a.begin(),_a.end())
#define SSORT(_a,_val) sort(_a,_a+(_val))
#define ALL(_a) _a.begin(),_a.end()

using namespace std;

const int dr[]={ 1, 0,-1, 0, 1, 1,-1,-1};
const int dc[]={ 0, 1, 0,-1, 1,-1,-1, 1};
const double eps=1e-9;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;
typedef pair<double,double> pdd;
typedef vector<pdd> vpdd;
const int INF=0x7FFFFFFF;
const ll INFLL=0x7FFFFFFFFFFFFFFFLL;
const double pi=acos(-1);

template <class T> T take(queue<T> &O) {T tmp=O.front();O.pop();return tmp;}
template <class T> T take(stack<T> &O) {T tmp=O.top();O.pop();return tmp;}
template <class T> T take(priority_queue<T> &O) {T tmp=O.top();O.pop();return tmp;}
template <class T> inline void getint(T &num)
{
	bool neg=0;
	num=0;
	char c;
	while ((c=getchar_unlocked()) && (!isdigit(c) && c!='-'));
	if (c=='-')
	{
		neg=1;
		c=getchar_unlocked();
	}
	do num=num*10+c-'0';
	while ((c=getchar_unlocked()) && isdigit(c));
	num*=(neg)?-1:1;
}

template <class T> inline bool inRange(T z, T a, T b){return a <= z && z <= b;}

void OPEN(string in="input.txt",string out="output.txt")
{
	freopen(in.c_str(),"r",stdin);
	freopen(out.c_str(),"w",stdout);
	return ;
}

//using sokokaleb's template v3.0


#include <cstdio>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <set>
#include <stack>
#include <deque>
#define pb push_back

#define mp make_pair
#define f first
#define s second
#define ll long long

using namespace std;

int main() {
#ifndef ONLINE_JUDGE
  ifstream cin("test.in");
  ofstream cout("test.out");
#endif

  int N, K; cin >> N >> K;
  int small = 1, big = K + 1;
  for (int i = 0; i <= K; ++i) {
    if (i % 2 == 0) {
      cout << small << " " ;
      small += 1;
    } else {
      cout << big << " ";
      big -= 1;
    }
  }
  for (int i = K + 2; i <= N; ++i) {
    cout << i << " ";
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

    int n,k;
    cin>>n>>k;
    int a[n];
    for(int i=0;i<n;++i){
        a[i]=i+1;
    }

    int l=0,r=n-1,f=1;
    while(k--){
        if(f)printf("%d ",a[l++]);
        else printf("%d ",a[r--]);
        f^=1;
    }
    while(f==0 && l<=r){
        printf("%d ",a[l++]);
    }
    while(f==1 && r>=l){
        printf("%d ",a[r--]);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

    int n,k;
    cin>>n>>k;
    int a[n];
    for(int i=0;i<n;++i){
        a[i]=i+1;
    }

    int l=0,r=n-1,f=1;
    while(k--){
        if(f)printf("%d ",a[l++]);
        else printf("%d ",a[r--]);
        f^=1;
    }
    while(l<=r){
        printf("%d ",a[l++]);
    }
    return 0;
}


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

int n, k;

int main()
{
#ifdef DEBUG
	freopen("data.in", "r", stdin);
#endif
	ios_base::sync_with_stdio(false);

	cin >> n >> k;
	int low = 2, high = n;
	printf("1");
	for(int i = 0; i < k - 1; i++) {
		if(i & 1) printf(" %d", low++);
		else printf(" %d", high--);
	}
	if(k&1) {
		while(low <= high) {
			printf(" %d", low++);
		}
	} else {
		while(high >= low) {
			printf(" %d", high--);
		}
	}
	printf("\n");

#ifdef DEBUG
	printf("Time elapsed: %ld ms\n", 1000*clock()/CLOCKS_PER_SEC);
#endif
	return 0;
}


//ITNOG
#include<bits/stdc++.h>

using namespace std;
#define int long long
const int maxN = 100*1000 + 5;
const int inf = 1000*1000*1000;

main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int n, k; cin >> n >> k;
    int cur = 1, st = 1; k --;
    for(int i = 0; i < n; i ++)
    {
	  cout << cur << ' ';
	  cur += st ;
	  if(k) st ++, k --;
    }
    cout << endl;
    return 0;
}


//ITNOG
#include<bits/stdc++.h>

using namespace std;
#define int long long
const int maxN = 100*1000 + 5;
const int inf = 1000*1000*1000;

main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int n, k; cin >> n >> k;

    for(int i = 0; i < n; i ++)
    {
	  if(k == 1)
	  {
		for(int j = i; j < n - i; j ++)
		    cout << j + 1 << ' ';
		cout << endl;
		return 0;
	  }
	  cout << i + 1 << ' ' << n - i << ' '; k --;
	  if(k == 1)
	  {
		for(int j = n - i - 1; j > i + 1; j --)
		    cout << j << ' ';
		cout << endl;
		return 0;
	  }
	  k --;
    }
    cout << endl;
    return 0;
}


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

int main()
{
    int n, k, a = 1;
    cin >> n >> k;
    vector <bool> v(n+1, false);
    set <int> s;
    s.insert(a);
    cout << a << " ";
    v[a] = true;
    while(s.size() != n){
        for(int i = 1; i <= k; i++){
            if(a + i <= n && !v[a+i]){
                a += i;
                s.insert(a);
                cout << a << " ";
                v[a] = true;
            }
            else if(a - i >= 1 && !v[a-i]){
                a -= i;
                s.insert(a);
                cout << a << " ";
                v[a] = true;
            }
        }
    }
    return 0;
}


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

int main()
{
    int n, k, a = 1;
    cin >> n >> k;
    vector <bool> v(n+1, false);
    cout << a << " ";
    v[a] = true;
    for(int i = k, j = 1; i >= 1; i--, j++){
        if(j % 2 == 0){
            a -= i;
        }
        else {
            a += i;
        }
        cout << a << " ";
        v[a] = true;
    }
    for(int i = 1; i <= n; i++){
        if(!v[i])
          cout << i << " ";
    }
    return 0;
}


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

int main()
{
    int n, k, a;
    cin >> n >> k;
    vector <bool> v(n+1, false);
    vector <int> s;
    a = n;
    s.push_back(a);
    v[a] = true;
    while(s.size() != n){
        for(int i = k; i >= 1; i--){
            if(a + i <= n && !v[a+i]){
                a += i;
                s.push_back(a);
                v[a] = true;
            }
            else if(a - i >= 1 && !v[a-i]){
                a -= i;
                s.push_back(a);
                v[a] = true;
            }
        }
    }
    for(int i = 0; i < s.size(); i++){
        cout << s[i] << " ";
    }
    return 0;
}


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

int main()
{
    int n, k, a = 1;
    cin >> n >> k;
    vector <bool> v(n+1, false);
    set <int> s;
    while(s.size() != n){
        s.insert(a);
        cout << a << " ";
        v[a] = true;
        for(int i = k; i >= 1; i--){
            if(a + i <= n && !v[a+i]){
                a += i;
                break;
            }
            else if(a - i >= 1 && !v[a-i]){
                a -= i;
                break;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k, l, r;

int main()
{
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n - k; i++)
        cout << i << " ";
    l = n - k + 1, r = n;
    while (l < r)
    {
        cout << r-- << " " << l++ << " ";
    }

    if (l == r)
        cout << l;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,k,x,s;
    scanf("%d%d",&n,&k);
    x=n-k;
    for(i=1;i<=x;i++)
    {
        printf("%d ",i);
    }
    s=1;
    for(i=k;i>0;i--)
    {
        x=x+i*s;
        printf("%d ",x);
        s=-s;
    }
    return 0;
}


#include <iostream>
#include <math.h>
#include <fstream>
//#include <conio.h>

using namespace std;

int main()
{
    ifstream fin("fence.in");
    ofstream fout("fence.out");

    int n, nom;
    double s;
    fin >> n;
    int x[n + 1], y[n + 1], x1, y1;
    for (int i=1; i<=n; i++)
        fin >> x[i] >> y[i];
    fin >> x1 >> y1;

    for (int i=2; i<=n; i++)
        {
             double a, b, c, p;
             a=sqrt((x1 - x[i])*(x1 - x[i]) + (y1 - y[i])*(y1 - y[i]));
             b=sqrt((x1 - x[i - 1])*(x1 - x[i - 1]) + (y1 - y[i - 1])*(y1 - y[i - 1]));
             c=sqrt((x[i - 1] - x[i])*(x[i - 1] - x[i]) + (y[i - 1] - y[i])*(y[i - 1] - y[i]));
             p=(a + b + c) / 2;
             if (s > p*(p - a)*(p - b)*(p - c) || i==2) {s=p*(p - a)*(p - b)*(p - c); nom=i - 1;}
        }
    for (int i=1; i<=n; i++)
    {
        fout << x[i] << " " << y[i] << endl;
        if (i==nom)
           fout << x1 << " " << y1 << endl;
    }

    return 0;
    //getch();
}


//by maximumSHOT

#define _USE_MATH_DEFINES

#include <iostream>
#include <cmath>
#include <math.h>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <time.h>
#include <clocale>
#include <fstream>
#include <conio.h>
#include <random>
#include <bitset>

using namespace std;

#define forx(i,n) for(int i(0);i < n;i++)
#define vec vector
#define mp make_pair
#define ALL(x) (x).begin(), (x).end()

typedef long L;
typedef long long LL;
typedef pair<LL, LL> pll;
typedef long double LD;
typedef vector<int> vint;
typedef vec<LL> vll;
typedef vector<vint> vvint;
typedef vector<double> vdouble;
typedef vector<vector<double>> vvdouble;
typedef vec<bool> vbool;
typedef vec<vec<bool>> vvbool;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef unsigned long long ull;
typedef unsigned int ui;
const int inf = 1000 * 1000 * 1000;
const LL inf64 = LL(inf) * inf;
const LL base  = 1e9+7;
const double pi = acos(-1.0);
template<typename T> inline T Sqr(T a){return a*a;}

// GL begin

// GL end

//Functions begin

//Functions end

bool solve()
{
    ios_base::sync_with_stdio(0);
    //setlocale(LC_ALL, "Russian");
    ifstream fin("input.txt");
    ofstream fout("output.txt");
    //#define cin fin
    //#define cout fout

    LL n, k;

    cin >> n >> k;

    LL now = n, delt = n - 1;

    for(int i(0);i < k - 1;i++)
    {
        cout << now << ' ';
        now += delt * (i % 2?1 : -1);
        delt--;
    }

    for(int i(k - 1);i < n;i++)
    {
        cout << now << ' ';
        now += (k % 2?-1 : 1);
    }

    //_getch();
    return true;
}

int main(int argc,char **argv)
{
    //while(solve());
    solve();

    return 0;
}


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

#define TASK ""

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> pair_int;
typedef pair<ll, ll> pair_ll;

#define all(v) v.begin(),v.end()
#define mp make_pair
#define pb push_back
ld eps =  1e-7;

const int INF = INT_MAX / 2, NINF = INT_MIN / 2;
const ld PI = acos(-1.0);

void prepareIO ()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    if (strlen(TASK) != 0)
    {
        freopen(TASK".in", "r", stdin);
        freopen(TASK".out", "w", stdout);
    }
#endif
}

void debout()
{
}

template <typename Head, typename... Tail>
void debout(Head H, Tail... T)
{
#ifdef _DEBUG
    cerr << H << ' ';
    debout(T...);
#endif
}

void stressout()
{
}

template <typename Head, typename... Tail>
void stressout(Head H, Tail... T)
{
#ifdef _DEBUG
    cout << H << ' ';
    debout(T...);
#endif
}

void solve1();

int main()
{
    prepareIO();
    solve1();

#ifdef _DEBUG
    fprintf(stderr, "%.6lf\n", (double) clock() / CLOCKS_PER_SEC);
#endif

    return 0;
}

bool check(vector<int> &arr, int k)
{
    set<int> S;
    for (int i = 1; i < arr.size(); i++)
    {
        S.insert(abs(arr[i]-arr[i-1]));
    }

    return S.size() == k;
}

void solve1()
{
    int n, k;
    cin >> n >> k;

    if (k == 1)
    {
        for (int i = 1; i <= n; i++)
            printf("%d ", i);
        return;
    }

    vector<int> arr;

    arr.push_back(1);
    int left = 2, right = k+1;
    while (left <= right)
    {
        arr.push_back(right);
        if (left < right)
            arr.push_back(left);
        left++;
        right--;
    }

    for (int i = k+1; i <= n; i++)
        arr.push_back(i);

    cerr << check(arr, k) << '\n';

    for (int i = 0; i < n; i++)
        printf("%d ", arr[i]);
    printf("\n");
}


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

#define TASK ""

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> pair_int;
typedef pair<ll, ll> pair_ll;

#define all(v) v.begin(),v.end()
#define mp make_pair
#define pb push_back
ld eps =  1e-7;

const int INF = INT_MAX / 2, NINF = INT_MIN / 2;
const ld PI = acos(-1.0);

void prepareIO ()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    if (strlen(TASK) != 0)
    {
        freopen(TASK".in", "r", stdin);
        freopen(TASK".out", "w", stdout);
    }
#endif
}

void debout()
{
}

template <typename Head, typename... Tail>
void debout(Head H, Tail... T)
{
#ifdef _DEBUG
    cerr << H << ' ';
    debout(T...);
#endif
}

void stressout()
{
}

template <typename Head, typename... Tail>
void stressout(Head H, Tail... T)
{
#ifdef _DEBUG
    cout << H << ' ';
    debout(T...);
#endif
}

void solve1();

int main()
{
    prepareIO();
    solve1();

#ifdef _DEBUG
    fprintf(stderr, "%.6lf\n", (double) clock() / CLOCKS_PER_SEC);
#endif

    return 0;
}

bool check(vector<int> &arr, int k)
{
    set<int> S;
    for (int i = 1; i < arr.size(); i++)
    {
        S.insert(abs(arr[i]-arr[i-1]));
    }

    return S.size() == k;
}

void solve1()
{
    int n, k;
    cin >> n >> k;

    if (k == 1)
    {
        for (int i = 1; i <= n; i++)
            printf("%d ", i);
        return;
    }

    vector<int> arr;

    arr.push_back(1);
    int left = 2, right = k+1;
    while (left <= right)
    {
        arr.push_back(right);
        if (left < right)
            arr.push_back(left);
        left++;
        right--;
    }

    for (int i = k+2; i <= n; i++)
        arr.push_back(i);

    cerr << check(arr, k) << '\n';

    for (int i = 0; i < n; i++)
        printf("%d ", arr[i]);
    printf("\n");
}


#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n, k;
	cin >> n >> k;

	int curr = 1;
	cout << curr;
	for(int i=1;i<n-k;++i){
		++curr;
		cout << ' ' << curr;

	}
	for(int i=k;i>0;--i){
		if(curr+i>n)
			curr -= i;
		else
			curr += i;
		cout << ' ' << curr;
	}
	cout << '\n';

}


#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n, k;
	cin >> n >> k;
	int m = 1;

	int curr = 1;
	cout << curr;
	for(int i=1;i<n-k;++i){
		++curr;
		cout << ' ' << curr;

	}
	for(int i=k;i>0;--i){
		curr += m*i;
		m = -m;
		cout << ' ' << curr;
	}
	cout << '\n';

}


/* 문제

*/

// 2014.

#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <functional>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <iostream>

#define TEST    printf("test\n")
#define A       first
#define B       second
#define MP      make_pair

using namespace std;

typedef long long ll;
typedef vector <double> vec_d;
typedef vector <vec_d>  vvec_d;
typedef vector <int>    vec_i;
typedef vector <vec_i>  vvec_i;
typedef pair <int, int> pair_i;
typedef pair < pair_i, pair_i > pp_i;

const int INF = 0x7fffffff;
const int MINF = 0x80000000;
const ll mod = 1000000007;
const int cons = 100001;

int ans[cons];
bool num[cons];

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    int n, k;

    cin >> n >> k;

    ans[0] = 1;
    ans[n - k] = n;

    num[1] = true;
    num[n] = true;

    bool foo = false;

    int diff = k - 1;

    for (int i = 1; i < n; i++)
    {
        if (ans[i] == 0 && foo == false)
        {
            ans[i] = ans[i - 1] + 1;
            num[ans[i]] = true;
            continue;
        }
        if (ans[i] == n)
        {
            foo = true;
            continue;
        }

        if (ans[i - 1] - diff > 0 && num[ans[i - 1] - diff] == false)
        {
            ans[i] = ans[i - 1] - diff;
            num[ans[i - 1] - diff] = true;
            diff--;
            continue;
        }

        if (ans[i - 1] + diff < n && num[ans[i - 1] + diff] == false)
        {
            ans[i] = ans[i - 1] + diff;
            num[ans[i - 1] + diff] = true;
            diff--;
            continue;
        }
    }

    for (int i = 0; i < n; i++)
    {
        printf("%d ", ans[i]);
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
main() {

    int n, k;
    scanf("%d%d", &n, &k);
    vector<int> a;
    for (int i = 1; i <= n; i++)
        a.push_back(i);

    reverse(a.begin(), a.begin() + k);

    for (int i : a)
        printf("%d ", i);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n, k;

int f(vector<int> a) {
    set<int> s;
    for (int i = 1; i < a.size(); i++)
        s.insert(abs(a[i] - a[i - 1]));
    return s.size();
}

void special_case(int n, int k) {
    vector<int> a;
    a.push_back(1);
    printf("1 ");
    int x = 2, y = n, timer = n - 1;
    for (; timer; timer--)
        if (timer % 2 == 0) a.push_back(x), printf("%d ", x++);
        else a.push_back(y), printf("%d ", y--);
    if (f(a) != k) exit(12);
}

main() {

    scanf("%d%d", &n, &k);

    if (n & 1 && n == k + 2 && n >= 5) {
        special_case(n, k);
        return 0;
    }

    set<char> unused;
    for (int i = 1; i <= n; i++)
        unused.insert(i);
    deque<int> a, b;
    vector<int> ans;
    for (int i = 1; i <= k / 2 + 1; i++)
        a.push_back(i), unused.erase(i);
    for (int i = 1; i <= k / 2; i++)
        b.push_front(a.back() + i), unused.erase(b.front());

    int timer = a.front() + 1;
    for (int i = 0; i < n; i++)
        if (i % 2 == 0)  {
            if (a.empty()) break;
            printf("%d ", a.front());
            ans.push_back(a.front());
            a.pop_front();
        } else {
            if (b.empty()) break;
            printf("%d ", b.front());
            ans.push_back(b.front());
            b.pop_front();
        }

    for (int i : unused)
        printf("%d ", i), ans.push_back(i);

    if (f(ans) != k) return cout << -1, 12;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n, k;

int f(vector<int> a) {
    set<int> s;
    for (int i = 1; i < a.size(); i++)
        s.insert(abs(a[i] - a[i - 1]));
    return s.size();
}

void special_case1(int n, int k) {
    vector<int> a;
    a.push_back(1);
    printf("1 ");
    int x = 2, y = n, timer = n - 1;
    for (; timer; timer--)
        if (x > y) exit(12);
        else if (timer % 2 == 0) a.push_back(x), printf("%d ", x++);
        else a.push_back(y), printf("%d ", y--);
}

void special_case2(int n, int k) {
    vector<int> a;
    for (int i = 1; i <= 3; i++) {
        printf("%d ", i);
        a.push_back(i);
    }
    int x = 4, y = n, timer = n - 2;
    for (; timer; timer--)
        if (x > y) exit(12);
        else if (timer % 2 == 0) a.push_back(x), printf("%d ", x++);
        else a.push_back(y), printf("%d ", y--);
    if (f(a) != k) exit(12);
}

main() {

    scanf("%d%d", &n, &k);

    if (k & 1) {
        printf("%d ", n--);
        k--;
    }

    if (n & 1 && n == k + 2 && n >= 5) {
        special_case1(n, k);
        return 0;
    }

    if (n % 2 == 0 && k == n - 3) {
        special_case2(n, k);
        return 0;
    }

    set<char> unused;
    for (int i = 1; i <= n; i++)
        unused.insert(i);
    deque<int> a, b;
    vector<int> ans;
    for (int i = 1; i <= k / 2 + 1; i++)
        a.push_back(i), unused.erase(i);
    for (int i = 1; i <= k / 2; i++)
        b.push_front(a.back() + i), unused.erase(b.front());

    int timer = a.front() + 1;
    for (int i = 0; i < n; i++)
        if (i % 2 == 0)  {
            if (a.empty()) break;
            printf("%d ", a.front());
            ans.push_back(a.front());
            a.pop_front();
        } else {
            if (b.empty()) break;
            printf("%d ", b.front());
            ans.push_back(b.front());
            b.pop_front();
        }

    for (int i : unused)
        printf("%d ", i), ans.push_back(i);

    if (f(ans) != k) return cout << -1, 12;
    return 0;
}


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

int main() {
    char s[100000];
    long int n,l,count = 0;
    cin>>n>>s;
    l = strlen(s);
    if(n > 26){
      cout<<"-1";
    }
    for(int i = 0; i < l-1; i++) {
        for(int j = i+1; j < l; j++) {
            if(s[i] == s[j])
            count++;
        }
    }
    cout<<count;
	// your code goes here
	return 0;
}


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

int main() {
    char s[100000];
    int n,l,count = 0;
    cin>>n>>s;
    l = strlen(s);
    for(int i=0; i < l-1; i++) {
        for(int j=i+1; j < l; j++) {
            if(s[i] == s[j])
            count++;
        }
    }
    cout<<count;
	// your code goes here
	return 0;
}


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

int main() {
    char s[100000];
    long int n,l,count = 0;
    cin>>n>>s;
    l = strlen(s);
    for(int i=0; i < l-1; i++) {
        for(int j=i+1; j < l; j++) {
            if(s[i] == s[j])
            count++;
        }
    }
    cout<<count;
	// your code goes here
	return 0;
}


#include<iostream>
#include<set>
using namespace std;

set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;
int ans;
set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

if(st.size()>26){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;
int ans;
set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

for(int i=0;i<s.size()-1;++i){
    if(s[i]!=s[i+1]){
        ans++;
    }
}

if(ans==0){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;
int ans;
set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

if(n-st.size()>26){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;

set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

if(st.size()==1){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;
int ans;
set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

for(int i=0;i<s.size();++i){
    if(s[i]!=s[i+1]){
        ans++;
    }
}

if(ans==0){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;
int ans;
set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

if(n-st.size()>=26){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<set>
using namespace std;
int ans;
set<char>st;

int main(){
    int n;
    cin>>n;
string s;
cin>>s;

for(int i=0;i<s.size();++i){
    st.insert(s[i]);
}

if(n-st.size()>26-st.size()){
    cout<<-1;
    return 0;}

if(n-st.size()>=26){
    cout<<-1;
    return 0;
}

cout<<n-st.size();
}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
using namespace std;

	int n, cnt = 0, i;
	bool visited[100005];
	string s;

int main() {
	cin >> n >> s;
	for (i = 0; i < n; ++i) {
		if (!visited[s[i]]) ++cnt;
		visited[s[i]] = true;
	}
	cout << ( n > 26  ? -1 : n - cnt) << endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;

int main() {
	int n, cnt = 0, i;
	bool visited[100005];
	string s;
	cin >> n >> s;
	for (i = 0; i < n; ++i) {
		if (visited[s[i]]) ++cnt;
		visited[s[i]] = false;
	}
	cout << (n - cnt) << endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;

	int n, cnt = 0, i;
	bool visited[100005];
	string s;

int main() {
	cin >> n >> s;
	for (i = 0; i < n; ++i) {
		if (!visited[s[i]]) ++cnt;
		visited[s[i]] = true;
	}
	cout << ( cnt > 26  ? -1 : n - cnt) << endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;

	int n, cnt = 0, i;
	bool visited[100005];
	string s;

int main() {
	cin >> n >> s;
	for (i = 0; i < n; ++i) {
		if (!visited[s[i]]) ++cnt;
		visited[s[i]] = true;
	}
	cout << ( n-cnt >= 26  ? -1 : n - cnt) << endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;

	int n, cnt = 0, i;
	bool visited[100005];
	string s;

int main() {
	cin >> n >> s;
	for (i = 0; i < n; ++i) {
		if (!visited[s[i]]) ++cnt;
		visited[s[i]] = true;
	}
	cout << ( n-cnt > 26  ? -1 : n - cnt) << endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;

	int n, cnt = 0, i;
	bool visited[10005];
	string s;

int main() {
	cin >> n >> s;
	for (i = 0; i < n; ++i) {
		if (!visited[s[i]]) ++cnt;
		visited[s[i]] = true;
	}
	cout << n - cnt << endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;
	int substract;

	char temp[100000];
	str.copy(temp,str.length());

	int z;

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//z=(static_cast<int>(temp[i])%97);
		//cout<<z;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]!=0)
			substract=+1;
		if(letters[i]>1)
			counter+=letters[i]-substract;
	}
	if(counter>=26)
		cout<<"-1";
	else
	cout<<counter;

	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;

	char temp[100000];
	str.copy(temp,str.length());

	int z;

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//z=(static_cast<int>(temp[i])%97);
		//cout<<z;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]>1)
			counter+=letters[i]-1;
	}
	if(counter>26)
		cout<<"-1";
	else
	cout<<counter;

	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;
	int substract;
	int test;
	char temp[100000];
	int alpha;
	str.copy(temp,str.length());

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//test=(static_cast<int>(temp[i])%97);
		//cout<<test;
	}

	for(int i=0;i<26;i++)
	{
		if (letters[i]!=0)
			alpha+=1;
		if(letters[i]>1)
			substract=+1;
		if(letters[i]>1)
			counter+=letters[i]-1;
	}
	if(counter>(26-alpha))
		cout<<"-1";
	else
	cout<<counter;

	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;

	char temp[100000];
	str.copy(temp,str.length());

	int z;

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//z=(static_cast<int>(temp[i])%97);
		//cout<<z;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]>1)
			counter+=letters[i]-1;
	}
	cout<<counter;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;

	char temp[100000];
	str.copy(temp,str.length());

	int z;

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//z=(static_cast<int>(temp[i])%97);
		//cout<<z;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]>1)
			counter+=letters[i]-1;
	}
	if(counter>=26)
		cout<<"-1";
	else
	cout<<counter;

	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;
	int substract;

	char temp[100000];
	str.copy(temp,str.length());

	int z;

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//z=(static_cast<int>(temp[i])%97);
		//cout<<z;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]!=0)
			substract=+1;
		if(letters[i]>1)
			counter+=letters[i]-substract;
	}
	if(counter>=26)
		cout<<"-1";
	else
	cout<<counter;
	system("pause");
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;

	char temp[100000];
	str.copy(temp,str.length());

	int z;

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//z=(static_cast<int>(temp[i])%97);
		//cout<<z;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]>1)
			counter+=letters[i]-1;
	}
	if(counter>25)
		cout<<"-1";
	else
	cout<<counter;

	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int letters[26];
int main()
{
	int str_len;
	cin>>str_len;
	string str;;
	cin>>str;
	int counter=0;
	int substract;
	int test;
	char temp[100000];
	str.copy(temp,str.length());

for(int i=0;i<str.length();i++)
	{
		letters[(static_cast<int>(temp[i])%97)]+=1;
		//test=(static_cast<int>(temp[i])%97);
		//cout<<test;
	}

	for(int i=0;i<26;i++)
	{
		if(letters[i]>1)
			substract=+1;
		if(letters[i]>1)
			counter+=letters[i]-substract;
	}
	if((counter+(str_len-substract))>=26)
		cout<<"-1";
	else
	cout<<counter;

	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, ans = 0; cin >> n;
	char s[n]; int a[26] = {};
	cin >> s;
	for(int i = 0; i < n; i++)
		ans += a[s[i] - 'a']++ == 0;
	if(n > 26)
		cout << -1 << endl;
	else cout << n - ans << endl;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, ans = 0; cin >> n;
	char s[n]; int a[26] = {};
	cin >> s;
	for(int i = 0; i < n; i++)
		a[s[i] - 'a']++;
	for(int i = 0; i < 26; i++)
		if(a[i] > 0 && ans < 26)
			ans += a[i]-1;
		else if(ans >= 26) break;
	if(ans < 26)
		cout << ans << endl;
	else cout << "-1" << endl;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, ans = 0; cin >> n;
	char s[n]; int a[26] = {};
	cin >> s;
	for(int i = 0; i < n; i++)
		a[s[i] - 'a']++;
	for(int i = 0; i < 26; i++)
		if(a[i] > 0 && ans < 27)
			ans += a[i]-1;
		else if(ans >= 27) break;
	if(ans < 27)
		cout << ans << endl;
	else cout << "-1" << endl;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, ans = 0; cin >> n;
	char s[n]; int a[26] = {};
	cin >> s;
	for(int i = 0; i < n; i++)
		a[s[i] - 'a']++;
	for(int i = 0; i < 26; i++)
		if(a[i] > 0 && ans < 27)
			ans += a[i]-1;
		else break;
	if(ans < 27)
		cout << ans << endl;
	else cout << "-1" << endl;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, ans = 0; cin >> n;
	char s[n]; int a[26] = {};
	cin >> s;
	for(int i = 0; i < n; i++)
		a[s[i] - 'a']++;
	for(int i = 0; i < 26; i++)
		if(a[i] > 0)
			ans += a[i]-1;

	cout << ans << endl;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	int n, ans = 0; cin >> n;
	char s[n]; int a[26] = {};
	cin >> s;
	for(int i = 0; i < n; i++)
		a[s[i] - 'a']++;
	for(int i = 0; i < 26; i++)
		if(a[i] > 0 && ans < 26)
			ans += a[i]-1;
		else if(ans >= 26) break;
	if(ans < 26 && n < 27)
		cout << ans << endl;
	else cout << "-1" << endl;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0},n,ans=0,c=0;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;}
    for (int i=0;i<27;i++)
    {if (arr[i]!=0){c++;}
    if (arr[i]>0){ans+=arr[i]-1;}
    }
    if (ans>=26||ans>26-c){cout<<-1;}
    else  {cout<<ans;}

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0};
    int n;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;
    }
    int ans=0;
    for (int i=0;i<27;i++)
    {

    if (arr[i]>0){ans+=arr[i]-1;}
    }

   if (ans>27){cout<<-1;}
      else  {cout<<ans;}

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0};
    int n;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;
    }
    int c=0;
    int ans=0;
    for (int i=0;i<27;i++)
    {
    if (arr[i]!=0){c++;}
    if (arr[i]>0){ans+=arr[i]-1;}
    }

   if (ans>=26||ans>26-c){cout<<-1;}
      else  {cout<<ans;}

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0};
    int n;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;
    }
    int ans=0;
    for (int i=0;i<27;i++)
    {

    if (arr[i]>0){ans+=arr[i]-1;}
    }

   if (ans>=26){cout<<-1;}
      else  {cout<<ans;}

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0},n,ans=0,c=0;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;}
    for (int i=0;i<27;i++)
    {if (arr[i]!=0){c++;}
    if (arr[i]>0){ans+=arr[i]-1;}
    }
    if (ans>26-c){cout<<-1;}
    else  {cout<<ans;}

    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int arr[27]={0};
    int n;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;
    }
    int ans=0;
    for (int i=0;i<27;i++)
    {

        if (arr[i]==2){ans++;}
    }
    cout<<ans;

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0};
    int n;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;
    }
    int ans=0;
    for (int i=0;i<27;i++)
    {

    if (arr[i]>0){ans+=arr[i]-1;}
    }

   if (ans>26){cout<<-1;}
      else  {cout<<ans;}

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{   int arr[27]={0};
    int n;
    cin>>n;
    string mario;
    cin>>mario;
    for (int i=0;i<mario.size();i++){arr[mario[i]-97]++;
    }
    int ans=0;
    for (int i=0;i<27;i++)
    {

    if (arr[i]>0){ans+=arr[i]-1;}
    }
    cout<<ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    string s;
    cin>>s;
    sort(s.begin(),s.end());

    s.erase(std::unique(s.begin(),s.end()),s.end());

   if(n>26)
     cout<<"-1";

    else
      cout<<n-s.size();

    return 0;

}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main() {

     long int n;
     scanf("%ld",&n);
     string s;
     cin>>s;
     int h[26],i;
     for(i=0;i<26;++i)
         h[i]=0;

     for(i=0;i<s.length();++i)
      {
          h[s[i]-97]++;
      }

      long int sum=0;
      for(i=0;i<26;++i)
       {
           if(h[i]>1)
             sum+=(h[i]-1);
       }

       printf("%ld",sum);

    	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    string s;
    cin>>s;
    sort(s.begin(),s.end());

    s.erase(std::unique(s.begin(),s.end()),s.end());

   if(n-s.size()>=26)
      cout<<"-1";

    else
      cout<<n-s.size();

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    string s;
    cin>>s;
    sort(s.begin(),s.end());

    s.erase(std::unique(s.begin(),s.end()),s.end());

    cout<<n-s.size();

    return 0;

}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main() {

     long int n;
     scanf("%ld",&n);
     string s;
     cin>>s;
     long int h[26],i,cnt=0;
     for(i=0;i<26;++i)
         h[i]=0;

     for(i=0;i<s.length();++i)
      {
          h[s[i]-97]++;

      }

     for(i=0;i<26;++i)
       {
           if(h[i]>0)
             cnt++;
       }

      if(cnt==1)
         printf("-1");

    else
    {
      long int sum=0;
      for(i=0;i<26;++i)
       {
           if(h[i]>1)
             sum+=(h[i]-1);
       }

       printf("%ld",sum);

    }

    	return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main() {

     long int n;
     scanf("%ld",&n);
     string s;
     cin>>s;
     long int h[26],i,cnt=0;
     for(i=0;i<26;++i)
         h[i]=0;

     for(i=0;i<s.length();++i)
      {
          h[s[i]-97]++;
          cnt++;
      }

      if(cnt==1)
        {
            printf("-1");
        }

    else
    {
      long int sum=0;
      for(i=0;i<26;++i)
       {
           if(h[i]>1)
             sum+=(h[i]-1);
       }

       printf("%ld",sum);

    }

    	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    string s;
    cin>>s;
    sort(s.begin(),s.end());

    s.erase(std::unique(s.begin(),s.end()),s.end());

   if(n-s.size()>26)
      cout<<"-1";

    else
      cout<<n-s.size();

    return 0;

}


#include<bits/stdc++.h>
//#define M 1000000
using namespace std;
typedef long long int ll;
int main()
{

    ll a,b,c,d,e,f,toto,g,i,j,t,tc,x,n,k,sum,p,q,fotka;
        cin>>n;
        string s;
        set<char>st;
        cin>>s;
        for(i=0;i<n;i++)st.insert(s[i]);
        if(n>26)cout<<-1<<endl;
       else cout<<n-st.size();
    return 0;
}


#include<bits/stdc++.h>
//#define M 1000000
using namespace std;
typedef long long int ll;
int main()
{

    ll a,b,c,d,e,f,toto,g,i,j,t,tc,x,n,k,sum,p,q,fotka;
        cin>>n;
        string s;
        set<char>st;
        cin>>s;
        for(i=0;i<n;i++)st.insert(s[i]);
        if(n-st.size()>26)cout<<-1<<endl;
       else cout<<n-st.size();
    return 0;
}


#include<bits/stdc++.h>
//#define M 1000000
using namespace std;
typedef long long int ll;
int main()
{

    ll a,b,c,d,e,f,toto,g,i,j,t,tc,x,n,k,sum,p,q,fotka;
        cin>>n;
        string s;
        cin>>s;c=0;
        for(i=0;i<s.size();i++)
        {
            for(j=i+1;j<=s.size();j++)
            {
                if(s[i]==s[j] && s[i]!='S')
                {
                    c++;
                     s[j]='S';
                     //s[i]=='S';
                }
            }
        }
        cout<<c<<endl;
    return 0;
}


#include<bits/stdc++.h>
//#define M 1000000
using namespace std;
typedef long long int ll;
int main()
{

    ll a,b,c,d,e,f,toto,g,i,j,t,tc,x,n,k,sum,p,q,fotka;
        cin>>n;
        string s;
        cin>>s;c=0;
        for(i=0;i<s.size();i++)
        {
            for(j=i+1;j<=s.size();j++)
            {
                if(s[i]==s[j])
                {
                    c++;
                     s[i]=='S';
                }
            }
        }
        cout<<c<<endl;
    return 0;
}


#include<bits/stdc++.h>
//#define M 1000000
using namespace std;
typedef long long int ll;
int main()
{

    ll a,b,c,d,e,f,toto,g,i,j,t,tc,x,n,k,sum,p,q,fotka;
        cin>>n;
        string s;
        set<char>st;
        cin>>s;
        for(i=0;i<n;i++)st.insert(s[i]);
        if(n-st.size()>=26)cout<<-1<<endl;
       else cout<<n-st.size();
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    if (count(s.begin(),s.end(),s[0])==a){
        cout<<a-1;
        return 0;
    }
    sort(s.begin(),s.end());

    for (int i=0;i<a;i++){
       if(s[i]==s[i+1]){d++;}
    }
    cout<<d;
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    if (s.count(s[0]==a)){
        cout<<a-1;
        return 0;
    }
    sort(s.begin(),s.end());

    for (int i=0;i<a;i++){
       if(s[i]==s[i+1]){d++;}
    }
    cout<<d;
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    sort(s.begin(),s.end());
    for (int i=0;i<a;i++){
        d+=count(s.begin(),s.end(),s[i])-1;
        i+=count(s.begin(),s.end(),s[i]);
    }

    cout<<d;
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    sort(s.begin(),s.end());

    for (int i=0;i<a;i++){
       if(s[i]==s[i+1]){d++;}
    }
    cout<<d;
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    sort(s.begin(),s.end());
    for (int i=0;i<a;i++){
        d+=count(s.begin(),s.end(),s[i])-1;
        i+=count(s.begin(),s.end(),s[i])-1;
    }
    cout<<d;
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    sort(s.begin(),s.end());
    for (int i=0;i<a;i=i){
        d+=count(s.begin(),s.end(),s[i])-1;
        i+=count(s.begin(),s.end(),s[i]);

    }

    cout<<d;
    return 0;
}


#include <iostream>

#include <algorithm>

using namespace std;

int main()

{

    int a,d=0;cin>>a;

    string s;cin>>s;

    sort(s.begin(),s.end());

    if(s.size()>26){

        cout<<-1;

        return 0;

    }

    for (int i=0;i<a;i++){

       if(s[i]==s[i+1]){d++;}

    }

    cout<<d<<"\n";

    return 0;

}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,d=0;cin>>a;
    string s;cin>>s;
    if (s.find(s[0]==a)){
        cout<<a-1;
        return 0;
    }
    sort(s.begin(),s.end());

    for (int i=0;i<a;i++){
       if(s[i]==s[i+1]){d++;}
    }
    cout<<d;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int INF = 1<<29;
const int N = 1e5 + 9;
ll a[N], b[N];
int main()
{
    fio;
    ll n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    map <char, ll> m;
    map <char, ll> :: iterator it;
    for(int i = 0; i < n; i ++){
        m[s[i]] ++;
    }
    for(it = m.begin(); it != m.end(); it ++){
        if(it->second > 1){
            ans += ((it->second) - 1);
        }
    }
    if(ans > 26){
        cout << -1 << endl;
    }
    else cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int INF = 1<<29;
const int N = 1e5 + 9;
ll a[N], b[N];
int main()
{
    fio;
    ll n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    map <char, ll> m;
    map <char, ll> :: iterator it;
    for(int i = 0; i < n; i ++){
        m[s[i]] ++;
    }
    for(it = m.begin(); it != m.end(); it ++){
        if(it->second > 1){
            ans += ((it->second) - 1);
        }
    }
    if(ans >= 26){
        cout << -1 << endl;
    }
    else cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int INF = 1<<29;
const int N = 1e5 + 9;
ll a[N], b[N];
int main()
{
    fio;
    ll n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    map <char, ll> m;
    map <char, ll> :: iterator it;
    for(int i = 0; i < n; i ++){
        m[s[i]] ++;
    }
    for(it = m.begin(); it != m.end(); it ++){
        if(it->second > 1){
            ans ++;
        }
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int INF = 1<<29;
const int N = 1e5 + 9;
ll a[N], b[N];
int main()
{
    fio;
    ll n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    map <char, ll> m;
    map <char, ll> :: iterator it;
    for(int i = 0; i < n; i ++){
        m[s[i]] ++;
    }
    for(it = m.begin(); it != m.end(); it ++){
        if(it->second > 1){
            ans += ((it->second) - 1);
        }
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int INF = 1<<29;
const int N = 1e5 + 9;
ll a[N], b[N];
int main()
{
    fio;
    ll n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    map <char, ll> m;
    map <char, ll> :: iterator it;
    for(int i = 0; i < n; i ++){
        m[s[i]] ++;
    }
    ll kkk = 0, kk = 0;
    for(char ch = 'a'; ch <= 'z'; ch ++){
        //cout << m[ch] << " ";
        if(m[ch] == 0){
            kk ++;
        }
        else if(m[ch] > 1){
            kkk += (m[ch] - 1);
        }
    }
    if(kkk - kk > 0){
        cout << -1 << endl;
    }
    else cout << kkk << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int INF = 1<<29;
const int N = 1e5 + 9;
ll a[N], b[N];
int main()
{
    fio;
    ll n, ans = 0;
    cin >> n;
    string s;
    cin >> s;
    map <char, ll> m;
    map <char, ll> :: iterator it;
    for(int i = 0; i < n; i ++){
        m[s[i]] ++;
    }
    for(it = m.begin(); it != m.end(); it ++){
        if(it->second > 1){
            ans += ((it->second) - 1);
        }
    }
    if(ans > 26){
        cout << -1 << endl;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n;
    cin>>n;
     string s;
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        s+=c;
    }
    //cin>>s;
    int l=s.length();
    map<char,int>m;
    map<char,int>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }

    int co=0;
    int f=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>26)
        {
            cout<<"-1"<<endl;
            f=1;
            break;
        }
        if(it->second>1&&it->second<=26)
        {
            co+=it->second-1;
        }
    }
    if(f==0)
    cout<<co<<endl;


Copy
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n;
    cin>>n;
     string s;
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        s+=c;
    }
    //cin>>s;
    int l=s.length();
    map<char,int>m;
    map<char,int>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }

    int co=0;
    int f=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>26)
        {
            cout<<"-1"<<endl;
            f=1;
            break;
        }
        if(it->second>1&&it->second<26)
        {
            co+=it->second-1;
        }
    }
    if(f==0)
    cout<<co<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int l=s.length();
    map<char,int>m;
    map<char,int>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }
    int co=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>1)
        {
            co+=it->second-1;
        }
    }
    cout<<co<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int l=s.length();
    map<char>m;
    map<char>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }
    int co=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>1)
        {
            co+=it->second-1;
        }
    }
    cout<<co<<endl;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n;
    cin>>n;
     string s;
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        s+=c;
    }
    //cin>>s;
    int l=s.length();
    map<char,int>m;
    map<char,int>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }

    int co=0;
    int f=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>26)
        {
            cout<<"-1"<<endl;
            f=1;
            break;
        }
        if(it->second>1&&it->second<26)
        {
            co+=it->second-1;
        }
    }
    if(f==0)
    cout<<co<<endl;
}


#include<bits/stdc++.h>

typedef long long int ll;

#define dbg printf("in\n");
#define nl printf("\n");
#define pp pair<int,int>

using namespace std;

int main()
{
    //freopen("in.txt","r",stdin);

    int i,j,k;
    int n;
    string s;

    cin>>n>>s;

    set<char> ss;
    for(i=0;i<n;i++)
        ss.insert(s[i]);

    //possible to use k chars
    k=26-ss.size();

    //required changes
    j=n-ss.size();

    if(k<j)
        cout<<"-1";
    else
        cout<<j;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n;
    cin>>n;
     string s;
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        s+=c;
    }
    //cin>>s;
    int l=s.length();
    map<char,int>m;
    map<char,int>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }

    int co=0;
    int f=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>26)
        {
            cout<<"-1"<<endl;
            f=1;
            break;
        }
        if(it->second>1)
        {
            co+=it->second-1;
        }
    }
    if(f==0)
    cout<<co<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n;
    cin>>n;
     string s;
    for(int i=0;i<n;i++){
        char c;
        cin>>c;
        s+=c;
    }
    //cin>>s;
    int l=s.length();
    map<char,int>m;
    map<char,int>::iterator it;
    for(int i=0;i<l;i++)
    {
        m[s[i]]++;
    }

    int co=0;
    for(it=m.begin();it!=m.end();it++)
    {
        if(it->second>1)
        {
            co+=it->second-1;
        }
    }
    cout<<co<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n;
    cin>>n;
    cin>>s;
  int b[200];
    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }

    }
    if(c==0)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n;
    cin>>n;
    cin>>s;
  int b[200];
    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }

    }
    if(c>=26)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n,total=26;
    cin>>n;
    cin>>s;
  int b[200];

    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }
        if(arr[i]>=1)
        {
            total--;
        }

    }
    if(c>=total)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n,total=26;
    cin>>n;
    cin>>s;
  int b[200];

    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }
        if(arr[i]>=1)
        {
            total--;
        }

    }
    if(c>total)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n,total=26;
    cin>>n;
    cin>>s;
  int b[200];

    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }
        if(arr[i]==1)
        {
            total--;
        }

    }
    if(c>total)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n;
    cin>>n;
    cin>>s;
  int b[200];
    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }

    }
    if(c>26)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;

    int arr[200]={0},c=0,n,total=26;
    cin>>n;
    cin>>s;
  int b[200];

    for(int i=0;i<s.size();i++)
    {
         b[i]=s[i];

        arr[b[i]]++;

    }
    for(int i=97;i<123;i++)
    {
        if(arr[i]>1)
        {
            c=c+arr[i]-1;

        }
        if(arr[i]==1)
        {
            total--;
        }

    }
    if(c>=total)
        cout<<"-1";
    else
    cout<<c;
}


#include<bits/stdc++.h>
#define fi(i,n) for(i=0;i<n;++i)

using namespace std;

/*long long a[301][301];

bool isPossible(long long a[301][301],int m,int n)
{
    int i,j;
    if(a[0][0]>2 || a[0][n-1]>2 || a[m-1][0]>2 || a[m-1][n-1]>2)
    {
        return false;
    }
    fi(i,m)
        {
            fi(j,n)
            {
                if(i==0 || j==0 || i==m-1 || j==n-1)
                {
                    if(a[i][j]>3)return false;
                }
                else{
                    if(a[i][j]>4)return false;
                }
            }
        }
    return true;
}

int main()
{
    int t,n,m,i,j;
    cin>>t;
    while(t--)
    {
        cin>>m>>n;
        fi(i,m)
        {
            fi(j,n)
            {
                cin>>a[i][j];
            }
        }
        bool possible=isPossible(a,m,n);
        if(possible)
        {
            cout<<"YES\n";
            fi(i,m)
            {
                fi(j,n)
                {
                    if((i==0 && j==0) || (i==0 && j==n-1) || (i==m-1 && j==0) || (i==m-1 && j==n-1))
                    {
                        cout<<"2 ";
                    }
                    else if(i==0 || j==0 || i==m-1 || j==n-1)cout<<"3 ";
                    else cout<<"4 ";
                }
                cout<<"\n";
            }
        }
        else{
            cout<<"NO\n";
        }
    }
}*/
/*
int main()
{
    int n,curri,currj,i,t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        vector<int> a(n);
        fi(i,n)cin>>a[i];

        if(a[0]<a[n-1])cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}

int findLastOccurence(vector<int> a,int ele,int l,int r)
{
    int mid=l+(r-l)/2;
    int res=-1;
    while(l<=r)
    {
        mid=l+(r-l)/2;
        if(a[mid]==ele)
        {
            res=mid;
            l=mid+1;
        }
        else if(a[mid]<ele)
        {
            r=mid-1;
        }
        else{
            l=mid+1;
        }
    }
    return res;
}

int findFirstOccurence(vector<int> a,int ele,int l,int r)
{
    int res=-1;
    int mid=l+(r-l)/2;
    while(l<=r)
    {
        mid=l+(r-l)/2;
        if(a[mid]==ele)
        {
            res=mid;
            r=mid-1;
        }
        else if(a[mid]<ele)
        {
            r=mid-1;
        }
        else{
            l=mid+1;
        }
    }
    return res;
}

int main()
{
    int n,k,j;
    cin>>n>>k;
    vector<int> a(n);
    int i,ans;
    fi(i,n)cin>>a[i];

    if(a[0]==0)ans=0;
    else if(a[k-1]==0)
    {
        j=findFirstOccurence(a,a[k-1],0,a.size()-1);
        ans=j;
    }
    else{
        ans=findLastOccurence(a,a[k-1],k-1,a.size()-1)+1;
    }
    cout<<ans<<"\n";
    return 0;
}

int main()
{
    int m,n;
    cin>>m>>n;
    int tile=0;
    if(m%2!=0)
    {
        tile+=n;
        tile*=(m/2);
        tile+=(n/2);
    }
    else{
        tile+=n;
        tile*=(m/2);
    }
    cout<<tile<<"\n";
    return 0;
}

int main()
{
    int n,count=0;
    map<char,int> m;

    string s;
    cin>>s;
    n=s.size();
    int i=0;
    while(i<n)
    {
        if(!m.count(s[i]))
        {
            m[s[i]]=1;
            count++;
        }
        else{
            m[s[i]]++;
        }
        i++;
    }
    string ans=count%2!=0?"IGNORE HIM!\n":"CHAT WITH HER!\n";
    cout<<ans;
   return 0;
}
int main()
{
    int n,i,count=0,ans=INT_MIN;
    string s;
    cin>>n;
    cin>>s;
    fi(i,n-1)
    {
        while(s[i]==s[i+1] && i<n-1)
        {
            i++;
            count++;
        }
        //ans=max(ans,count);
    }
    cout<<count<<"\n";
    return 0;
}

int main()
{
    int i,countcaps=0,countlows=0;
    string s;
    cin>>s;
    int n=s.size();
    fi(i,n)
    {
        if(islower(s[i]))
        {
            countlows++;
        }
        else{
            countcaps++;
        }
    }
    if(countlows>=countcaps)
    {
        fi(i,n)
        {
            cout<<(char)tolower(s[i]);
        }
        cout<<"\n";
    }
    else{
        fi(i,n)
        {
            cout<<(char)toupper(s[i]);
        }
        cout<<"\n";
    }
    return 0;
}

long long maxPrimeFactors(long long n)
{
    // Initialize the maximum prime factor
    // variable with the lowest one
    long long maxPrime = -1;
    if(n==1)return 1;
    // Print the number of 2s that divide n
    while (n % 2 == 0) {
        maxPrime = 2;
        n >>= 1; // equivalent to n /= 2
    }

    // n must be odd at this point, thus skip
    // the even numbers and iterate only for
    // odd integers
    for (int i = 3; i <= sqrt(n); i += 2) {
        while (n % i == 0) {
            maxPrime = i;
            n = n / i;
        }
    }

    // This condition is to handle the case
    // when n is a prime number greater than 2
    if (n > 2)
        maxPrime = n;

    return maxPrime;
}

bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}

int main()
{
    int t;
    cin>>t;
    int n,i;
    while(t--)
    {
        cin>>n;
        if(n%2==0)
        {
            cout<<n/2<<"\n";
        }
        else{
            cout<<(n-1)/2<<"\n";
        }
    }
    return 0;
}
int main()
{
    int n;
    cin>>n;

        int ans=ceil((float)n/5);
        cout<<ans<<"\n";

    return 0;
}
int main()
{
    int n,k,w;
    cin>>k>>n>>w;
    int sum=(w*(w+1)/2)*k;
    int ans=(sum-n)>=0?sum-n:0;
    cout<<ans;
}
int main()
{
    int n,i,tot=INT_MAX;
    cin>>n;
    vector<int> a(n);
    map<int,vector<int>> m;
    vector<int> t;
    m[1]=t;
    m[2]=t;
    m[3]=t;
    fi(i,n)
    {
        cin>>a[i];

            m[a[i]].push_back(i+1);

    }
    for(auto itr=m.begin();itr!=m.end();++itr)
    {
        if(itr->second.size()<tot)tot=itr->second.size();
    }
    cout<<tot<<"\n";
    fi(i,tot)
    {
        cout<<m[1][i]<<" ";
        cout<<m[2][i]<<" ";
        cout<<m[3][i]<<" ";
        cout<<"\n";
    }
    return 0;
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,ans=0;
        cin>>a>>b;
        int side=2*min(a,b);
        ans=max(side,max(a,b));
        ans*=ans;
        cout<<ans<<"\n";
    }
    return 0;
}
int main()
{
    int n;
    string src,dest;
    cin>>n>>src>>dest;
    int i,ans=0;
    fi(i,n)
    {
        int d=max((int)(dest[i]),(int)(src[i]));
        int s=min((int)(dest[i]),(int)(src[i]));
        int diff=min(d-s,10-d+s);
        //cout<<diff<<" ";
        ans+=diff;
    }
    cout<<ans<<"\n";
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,i=1,j=0;
        cin>>n;
        if(n%2!=0){
            cout<<i<<" ";
            n--;
        }

        while(j<n)
        {
            cout<<i<<" "<<i<<" ";
            i+=2;
            j+=2;
        }
        cout<<"\n";
    }
    return 0;
}
int main()
{
    int t,i;
    cin>>t;
    while(t--)
    {
        vector<long long int> a(3);
        long long int count=0;
        fi(i,3){
            cin>>a[i];
            count+=a[i];
        }
        cout<<(count/2)<<"\n";
    }
    return 0;
}
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    int i,count=1;
    fi(i,n-1)
    {
        count=1;
        while(s[i]==s[i+1])
        {
            i++;
            count++;
        }
        if(count>=7)break;
    }
    if(count>=7)cout<<"YES";
    else cout<<"NO";
    return 0;
}
int main()
{
    int n,i,total=0,curr=0,count=0;
    cin>>n;
    vector<int> a(n);
    priority_queue<int> pq;
    fi(i,n){
        cin>>a[i];
        total+=a[i];
        pq.push(a[i]);
    }
    while(!pq.empty() && curr<=(total/2))
    {
        curr+=pq.top();
        count++;
        pq.pop();
    }
    cout<<count;
    return 0;
}
int main()
{
    int n,i;
    cin>>n;
    map<int,int> m;
    vector<int> b(n);

    fi(i,n){
        cin>>b[i];
        if(!m.count(b[i]))
        {
            m[b[i]]=1;
        }
    }
    int ans=m.size();
    cout<<ans;
    return 0;
}
vector<int> adj[2001];
vector<bool> visited(2001,false);
int res=INT_MIN;

void dfs(int node,int height)
{
    visited[node]=true;
    int i;
    res=max(res,height);
    fi(i,adj[node].size())
    {
        //cout<<adj[node][i]<<" ";
        if(!visited[adj[node][i]])
        dfs(adj[node][i],height+1);
    }
}

int main()
{
    int n,a;
    vector<int> root;
    cin>>n;
    int i;
    fi(i,n)
    {
        cin>>a;
        if(a!=-1)
        {
            adj[i].push_back(a-1);
            adj[a-1].push_back(i);
        }
        else root.push_back(i);
    }

    for(auto i:root)
    {
        dfs(i,1);
    }

    cout<<res;
    return 0;
}

int main()
{
    long long int n,i;
    cin>>n;
    vector<long long int> a(n);
    long long int countZeroes=0,res=0,neg=0;
    fi(i,n)
    {
        cin>>a[i];
        if(a[i]==0)countZeroes++;
    }
    fi(i,n)
    {
        if(a[i]>0)
        {
            res+=(a[i]-1);
        }
        else if(a[i]<0)
        {
            neg++;
            res+=(-1-a[i]);
        }
    }
    if(countZeroes>0)
    {
        res+=countZeroes;
    }
    else{
        if(neg%2!=0)
        res+=2;
    }
    cout<<res;
    return 0;
}
int main()
{
    int n,i;

        cin>>n;
        vector<int> a(12);
        fi(i,12)cin>>a[i];
        sort(a.begin(),a.end(),greater<int>());
        int ans=0,sum=0;i=0;
        while(i<12 && sum<n)
        {
            sum+=a[i];
            i++;
            ans++;
        }
        if(sum<n)ans=-1;
        cout<<ans<<"\n";

    return 0;
}
int main()
{
    int m,n,x,t;
    cin>>t;
    while(t--)
    {
        int temp;
        cin>>x>>m>>n;
        temp=x;
        while(m-- && (temp/2+10)<temp)
        {

                temp=temp/2+10;

        }
        temp=temp-n*10;
        if(temp>0)cout<<"NO\n";
        else cout<<"YES\n";
    }
    return 0;
}
int main()
{
    int n,i;
    cin>>n;
    vector<int> a(n+1);
    vector<int> ans;
    a[1]=1;
    for(i=2;i<=n;++i)cin>>a[i];
    i=n;
    ans.push_back(n);
    while(a[i]!=1)
    {
        ans.push_back(a[i]);
        i=a[i];
    }
    ans.push_back(a[i]);
    reverse(ans.begin(),ans.end());
    fi(i,ans.size())cout<<ans[i]<<" ";
    cout<<"\n";
    return 0;
}
int main()
{
    int i,n,flag=0;
    cin>>n;
    vector<int> a(n);
    vector<int> b;
    fi(i,n)cin>>a[i];
    sort(a.begin(),a.end());
    fi(i,n-1)
    {
        while(a[i]==a[i+1])i++;
        b.push_back(a[i]);
    }
    if(a[n-2]!=a[n-1])b.push_back(a[n-1]);
    fi(i,b.size())
    {
        if(b[i+1]-b[i]==1 && b[i+2]-b[i+1]==1)
        {
            cout<<"YES";
            flag=1;
            break;
        }
    }
    if(!flag)cout<<"NO";
    return 0;
}
int main()
{
    int count1=0,count2=0,count3=0,i,n;
    cin>>n;
    vector<int> a(n);
    fi(i,n)
    {
        cin>>a[i];
        if(a[i]==1)count1++;
        else if(a[i]==2)count2++;
        else count3++;
    }
    int maxcount=max(count1,max(count2,count3));
    int ans=n-maxcount;
    cout<<ans;
    return 0;
}
int main()
{
    string pass,s1,s2;
    cin>>pass;
    int n,i,flag=0;
    char a=pass[0];
    char b=pass[1];
    cin>>n;
    vector<string> barks(n);
    fi(i,n)cin>>barks[i];
    fi(i,n)
    {
        if(barks[i]==pass || (pass[0]==barks[i][1] && pass[1]==barks[i][0]))
        {
            flag=1;
            break;
        }
        else if(barks[i][0]==b)
        {
            s2=barks[i];
        }
        else if(barks[i][1]==a)
        {
            s1=barks[i];
        }
    }
    if(flag || (s1.size()>0 && s2.size()>0))
    cout<<"YES";
    else cout<<"NO";
    return 0;
}
int main()
{
    int n,k,i;
    cin>>n>>k;
    vector<int> a(n);
    fi(i,n)cin>>a[i];
    if(k>n || k==0)cout<<"-1";
    else{
        sort(a.begin(),a.end());
        cout<<a[n-k]<<" "<<a[n-k];
    }
    return 0;
}
int main()
{
    long long int m,n,a;
    cin>>n>>m>>a;
    cout<<((m+a-1)/a)*((n+a-1)/a);

    return 0;
}
int main()
{
    int t,n,i;
    cin>>t;
    while(t--)
    {
        cin>>n;
        vector<int> a(n);
        fi(i,n)cin>>a[i];
        int flag=1;
        sort(a.begin(),a.end());
        fi(i,n-1)
        {
            if(abs(a[i+1]-a[i])>1)
            {
                flag=0;
                break;
            }
        }
        if(flag)cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}
int main()
{
    int t,n,i;
    cin>>t;
    while(t--)
    {
        cin>>n;
        vector<long long int> a(n);
        vector<long long int> b(n);
        fi(i,n)cin>>a[i];
        fi(i,n)cin>>b[i];
        long long int mina=*min_element(a.begin(),a.end());
        long long int minb=*min_element(b.begin(),b.end());
        long long int ans=0;
        fi(i,n)
        {
            ans+=max(a[i]-mina,b[i]-minb);
        }
        cout<<ans<<"\n";
    }
    return 0;
}
int main()
{
    int t,n,i,j;
    cin>>t;
    while(t--)
    {
        cin>>n;
        vector<int> a(n);
        fi(i,n)cin>>a[i];
        sort(a.begin(),a.end());
        vector<int> temp(a[n-1]+a[n-2],0);
        fi(i,n-1)
        {
            for(j=i+1;j<n;++j)
            {
                while(a[j]==a[j+1] && j<n-1)j++;
                int sum=a[i]+a[j];
                if(a[i]!=a[i+1] || !temp[sum])
                temp[sum]++;
            }
        }
        cout<<*max_element(temp.begin(),temp.end())<<"\n";
    }
    return 0;
}

int main()
{
    string s,t;
    int n,i,flag=1;
    cin>>s;
    n=s.size();
    fi(i,n)
    {
        if(s[i]=='h' && t.size()==0)
        t.push_back('h');
        else if(s[i]=='e' && t.size()==1)t.push_back('e');
        else if(s[i]=='l' && (t.size()==2 || t.size()==3))t.push_back('l');
        else if(s[i]=='o' && t.size()==4)t.push_back('o');
    }
    if(t=="hello")cout<<"YES";
    else cout<<"NO";
    return 0;
}
bool isLucky(int n)
{
    int m=n;
    while(m)
    {
        int d=m%10;
        if(d!=4 && d!=7)return false;
        m/=10;
    }
    return true;
}

int main(){
    int n,flag=0;
    cin>>n;
    if(!isLucky(n))
    {
        for(int i=2;i<=n/2;++i)
        {
            if(n%i==0)
            {
                if(isLucky(n/i))
                {
                    flag=1;
                    break;
                }
            }
        }
        if(flag)cout<<"YES";
        else cout<<"NO";
    }
    else{
        cout<<"YES";
    }
    return 0;
}
int main()
{
    int a,b,c,ans;
    cin>>a>>b>>c;
    ans=a*b*c;
    ans=max(ans,a+b*c);
    ans=max(ans,(a+b)*c);
    ans=max(ans,a+b+c);
    ans=max(ans,a*(b+c));
    ans=max(ans,a*b+c);
    cout<<ans;

    return 0;
}

int main()
{
    long long int m,n,i;
    cin>>n>>m;
    vector<long long int> a(m);
    fi(i,m)cin>>a[i];
    long long int ans=a[0]-1;
    for(i=1;i<m;++i)
    {
        if(a[i]>=a[i-1])
        {
            ans+=(a[i]-a[i-1]);
        }
        else{
            ans+=(n-a[i-1]+a[i]);
        }
    }
    cout<<ans;

    return 0;
}
bool dfs(int node,vector<int> a,vector<bool>& visited,vector<int> adj[],int dest)
{
    visited[node]=true;
    if(node==dest)return true;
    for(auto i:adj[node])
    {
        if( !visited[i])
        {
            return dfs(i,a,visited,adj,dest);
        }
    }
    return false;
}

int main()
{
    int i,n,t,flag=0;
    cin>>n>>t;
    vector<int> a(n-1);
    vector<int> adj[n+1];
    fi(i,n-1)
    {
        cin>>a[i];
        adj[i+1].push_back(i+1+a[i]);
    }
    int curr=1;
    vector<int> route;
    fi(i,n-1)
    {
        if((i+1)==curr)
        {
            route.push_back(curr);
            curr=i+1+a[i];
        }
    }
    route.push_back(curr);
    /*vector<bool> visited(n+1,false);
    bool ans=dfs(1,a,visited,adj,t);
    if(ans)cout<<"YES";
    else cout<<"NO";
    fi(i,route.size())
    {
        //cout<<route[i]<<" ";
        if(route[i]==t)
        {
            flag=1;
            break;
        }
    }//cout<<"\n";
    if(flag)cout<<"YES";
    else cout<<"NO";
    return 0;
}
int main()
{
    int n,x,i,ans=0;
    cin>>n>>x;
    for(i=1;i<=n;++i)
    {
        if(x%i==0)
        {
            if(x/i<=n)ans++;
        }
    }
    cout<<ans;
    return 0;
}

int lcs(string a,string b)
{
    int m=a.size();
    int n=b.size();
    int dp[m+1][n+1];
    int i,j;
    fi(i,m+1)
    {
        fi(j,n+1)
        {
            if(i==0 || j==0)dp[i][j]=0;
        }
    }
    for(i=1;i<=m;++i)
    {
        for(j=1;j<=n;++j)
        {
            if(a[i]==b[j])
            {
                dp[i][j]=1+dp[i-1][j-1];
            }
            else{
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
        }
    }
    return dp[m][n];
}
int main()
{
    string a,b;
    cin>>a>>b;
    int lcslen=lcs(a,b);
    int ans=lcslen;
    if(a==b)cout<<"-1";
    else cout<<max(a.size(),b.size());
    return 0;
}
int main()
{
    int n;
    cin>>n;
    float i=n,ans=0;
    while(i)
    {
        ans+=(1/i);
        i--;
    }
    cout<<ans;
    return 0;
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(NULL);
    int n;
    cin>>n;
    if(n%2==0)
    cout<<(1<<(n/2));
    else cout<<"0";
    return 0;
}*/
int main()
{
    int n,i,ans=0;
    string s;
    map<char,int> m;
    cin>>n;
    cin>>s;
    i=0;
    while(i<n)
    {
        if(m.count(s[i])==0)
        {
            m[s[i]]=1;
        }
        else{
            m[s[i]]++;
        }
        i++;
    }
    for(auto itr=m.begin();itr!=m.end();++itr)
    {
        ans+=itr->second-1;
    }
    if((26-n-ans)<=0)ans=-1;
    cout<<ans;
    return 0;
}