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

int main()
{
    string s;
    while(cin>>s)
    {
        int m=s.length();
        cout<<s[0]<<m-2<<s[m-1]<<endl;
    }

    return 0;
}
