#include<iostream>
#include<cstdio>
#include<algorithm>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<map>
using namespace std;

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

	


		

	





		

	


