import java.io.*;
import java.util.*;

public class twi_pk {
	public static void main(String[] args) {
		new twi_pk().run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	boolean check(String s) {
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if ((c != '.') && (c != '/') && (c != ':')
					&& !((c >= 'a') && (c <= 'z')) && !((c >= '0') && (c <= '9')))
				return false;
		}
		return true;
	}

	public void solve() throws IOException {
		int l = nextInt();
		String s = br.readLine();
		int tl = s.length();
		in = new StringTokenizer(s);
		while (in.hasMoreTokens()) {
			String ss = in.nextToken();
			while (s.charAt(0) == ' ') {
				out.print(' ');
				s = s.substring(1);
			}
			s = s.substring(ss.length());
			if ((ss.length() <= 7)
					|| (!ss.substring(0, 7).equals("http://")) || (!check(ss))
					|| (tl <= l)) {
				out.print(ss);
				continue;
			}
			if (ss.length() - 3 <= tl - l) {
				tl -= (ss.length() - 3);
				out.print("...");
				continue;
			}
			ss = ss.substring(0, ss.length() - tl + l - 3).concat("...");
			tl = l;
			out.print(ss);
		}
		out.println();
		out.println(Math.max(tl - l, 0));
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			br = new BufferedReader(new FileReader("twi.in"));
			out = new PrintWriter("twi.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}