s = eval(input())

print((s[0] + str(len(s) - 2) + s[-1]))
s = eval(input())

print((s[0] + str(len(s[1:len(s) - 1])) + s[-1]))
s = eval(input())
print((s[0] + str(len(s) - 2) + s[-1]))

s = eval(input())
print((s[0] + str(len(s[1 : len(s) - 1])) + s[-1]))

-print((s[0] + str(len(s) - 2) + s[-1])) +print((s[0] + str(len(s[1 : len(s) - 1])) + s[-1]))