A wise man told Kerem "Different is good" once, so Kerem wants all things in his life to be different. 

Kerem recently got a string s consisting of lowercase English letters. Since Kerem likes it when things are different, he wants all substrings of his string s to be distinct. Substring is a string formed by some number of consecutive characters of the string. For example, string "aba" has substrings "" (empty substring), "a", "b", "a", "ab", "ba", "aba".

If string s has at least two equal substrings then Kerem will change characters at some positions to some other lowercase English letters. Changing characters is a very tiring job, so Kerem want to perform as few changes as possible.

Your task is to find the minimum number of changes needed to make all the substrings of the given string distinct, or determine that it is impossible.


-----Input-----

The first line of the input contains an integer n (1 ≤ n ≤ 100 000) — the length of the string s.

The second line contains the string s of length n consisting of only lowercase English letters.


-----Output-----

If it's impossible to change the string s such that all its substring are distinct print -1. Otherwise print the minimum required number of changes.


-----Examples-----
Input
2
aa

Output
1

Input
4
koko

Output
2

Input
5
murat

Output
0



-----Note-----

In the first sample one of the possible solutions is to change the first character to 'b'.

In the second sample, one may change the first character to 'a' and second character to 'b', so the string becomes "abko".

Difficulty: interview

Starter code:

Solutions:
#!/usr/bin/env python3

from collections import Counter

try:
    while True:
        n = int(input())
        s = input()
        if n > 26:
            print(-1)
        else:
            c = Counter(s)
            print(sum(c.values()) - len(c))

except EOFError:
    pass


import sys
n=int(input())
if n>26:
    print(-1)
    return
s=input()
f=set()
ctr=0
for i in s:
    if i in f:
        ctr+=1
    else:
        f.add(i)
print(ctr)

n = int(input())
print(-1 if n > 26 else n - len(set(input())))

n = int(input())
s = input()
if (n > 26):
    print(-1)
else:
    d = dict()
    for i in range(len(s)):
        d[s[i]] = d.get(s[i], 0) + 1
    ans = 0    
    for i in d:
        ans += d[i] - 1
    print(ans)

from sys import stdin
input = stdin.readline
n = int(input())
s = input().rstrip('\n')
m = set()
for i in s:
    m.add(i)
if len(s) > 26:
    print(-1)
else:
    print(len(s)-len(m))


n = int(input())
s = input()
ans = n - len(set(s))
if n > 26: ans = -1
print(ans)


n = int(input())

s = input()

x = len(s) - len(set(s))

if len(set(s)) + x > 26:
    print(-1)
else:
    print(x)


n = int(input())
if (n > 26):
    print(-1)
else:
    s = input().rstrip()
    print(len(s) - len(set(list(s))))

n=int(input())
s=input()
if len(s)>26: print(-1)
else: print(n-len(set(s)))

alth = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
s = input()
temp = [0]*26
if n > 26:
    print(-1)
else:
    for i in s:
        temp[alth.find(i)] = 1
    print(n - sum(temp))
    


a = int(input())
s = list(input())
if a >26:
	print(-1)
else:
	b = set()
	for i in s:
		b.add(i)
	print(a-len(b))
		


from collections import Counter
n = int(input())
s = input()
c = Counter(s)
ans = 0
for x in c:
    if c[x] > 1:
        ans += c[x] - 1
print(-1 if n > 26 else ans)


#! /usr/bin/python
# kmwho
# Codeforces 352 D2



def solvecase():
    return ""

def solve():
    N = int(input())
    s = input().strip()
    l = len(s)
    if N > 26:
    	return -1
    count = len(set( c for c in s ))
    return l - count

def main():
	ans = solve()
	print(ans)


main()


n=int(input())
s = str(input())
#alpha = 'abcdefghijklmnopqrstuvwxyz'
count=0
used=[]
if n>26:
    print(-1)
else:
    for i in s:
        if i not in used:
            count+=s.count(i)-1
            used.append(i)
    print(count)


__author__ = 'Utena'
n=int(input())
s=input()
t=0
now=set()
if n>26:print(-1)
else:
    for a in s:
        if a in now:
            t+=1
        else:
            now.add(a)
    print(t)

n = int(input())
s = input()

if n > 26:
    print(-1)
else:
    print(n - len(set(s)))


#!/usr/bin/env python3
input()
s = input()

ans = 0
if len(s) > 26:
    print(-1)
    quit()

for let in 'abcdefghijklmnopqrstuvwxyz':
    ans+=max(0, s.count(let)-1)

print(ans)


n = int(input())
s = input()
if n > 26:
    print(-1)
else:
    A = set()
    for i in range(n):
        A.add(s[i])
    print(n - len(A))

def main():
    n = int(input())
    print(n - len(set(input())) if n < 27 else -1)


def __starting_point():
    main()

__starting_point()

def diff_subs(inp):
    if len(inp) > 26:
        return -1
    return len(inp) - len(set(inp))
useless = input()
print(diff_subs(input().strip()))


from collections import defaultdict
n = int(input())

if n > 26:
    print("-1")
else:
    s = input().strip()

    count = defaultdict(int)
    ans = 0
    for c in s:
        if count[c] >= 1:
            ans += 1
        else:
            count[c] += 1
    print(ans)


n = int(input())
s = input()
print(n - len(set(s)) if n <= 26 else -1)

import random

def __starting_point():
    #n, m = list(map(int, input().split()))
    n = int(input())
    s = input()
    if n > 26:
        print(-1)
    else:
        a = [0] * 26
        cnt = 0
        for i in range(n):
            if a[ord(s[i]) - ord('a')]:
                cnt += 1
            else:
                a[ord(s[i]) - ord('a')] = 1
        print(cnt)
    
    

__starting_point()

_ = input()
s = input()
unique = len(set(s))

if len(s) > 26:
    print(-1)
else:
    print(len(s) - unique)


import sys

n = int(input())

if n > 26:
    print('-1')
    return

input_str = input()
res = 0
symbols = set()
for it in input_str:
    if it in symbols:
        res += 1
    else:
        symbols.add(it)
print(res)