#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <assert.h>

using namespace std;

int main()
{
    freopen("twi.in", "r", stdin);
    freopen("twi.out", "w", stdout);
    int l;
    scanf("%d\n", &l);
    assert(1 <= l && l <= 10000);
    
    string s;
    getline(cin, s);
    int si = s.size();
    assert(1 < si && si <= 10000);
    if (l >= si)
    {
        cout << s << endl;
        cout << "0\n";
        return 0;
    }

    string ans = "";
    int dif = si - l;
    for (int i = 0; i < si; i++)
    {
        if ((i == 0 || i > 0 && s[i-1] == ' ') && s.substr(i, 7) == "http://" && s[i+7] != ' ')
        {
            int j = i;
            while (j < si)
            {
                if (s[j] == ' ') {break;};
                j++;                         
            }

            int len = j - i;
            int kol = max(0, len - dif - 3);
            dif = dif - (len - kol - 3);
            for (int k = i; k < i + kol; k++)
                ans += s[k];
            ans += "...";
            
            i = j - 1;
            if (dif == 0) 
			{
				for (int k = j; k < si; k++)
					ans += s[k];
				break;
			}
        }
        else
            ans +=s[i];
    } 
    cout << ans << endl;
    cout << dif << endl;
}
