import static java.util.Arrays.deepToString;

import java.io.*;

public class twi_nn {

	static final String LINK_PREFIX = "http://";
	private static final int MAXMAXLENGTH = 1000;
	private static final int MAXSLENGTH = 10000;

	static boolean check(String s) {
		if (s.startsWith(" ") || s.endsWith(" ")) {
			return false;
		}
		for (char c : s.toCharArray()) {
			if (c < 32 || c > 126) {
				return false;
			}
		}
		return true;
	}

	static void solve() throws Exception {
		int maxLength = Integer.parseInt(br.readLine());
		assert 1 <= maxLength && maxLength <= MAXMAXLENGTH;
		String s = br.readLine();
		assert 1 <= s.length() && s.length() <= MAXSLENGTH;
		assert check(s);
		int left = -1;
		int right = -1;
		for (int i = s.indexOf(LINK_PREFIX); i >= 0; i = s.indexOf(LINK_PREFIX,
				i + 1)) {
			if (i > 0 && s.charAt(i - 1) != ' ') {
				continue;
			}
			int length = getLengthOfLink(s, i);
			if (length > 0) {
				if (left >= 0) {
					throw new AssertionError("two links found, pos = " + left + ", " + i);
				}
				left = i;
				right = i + length;
			}
		}
		if (left < 0) {
			throw new AssertionError("no link found");
		}
		if (s.length() <= maxLength) {
			out.println(s);
			out.println(0);
		} else if (maxLength <= s.length() - (right - left) + 3) {
			String output = s.substring(0, left) + "..." + s.substring(right);
			out.println(output);
			out.println(output.length() - maxLength);
		} else {
			int cut = (right - left) - (s.length() + 3 - maxLength);
			out.println(s.substring(0, left + cut) + "..." + s.substring(right));
			out.println(0);
		}
	}

	static int getLengthOfLink(String s, int begin) {
		int end = begin + LINK_PREFIX.length();
		if (end >= s.length() || !isLinkChar(s.charAt(end))) {
			return -1;
		}
		while (end < s.length() && isLinkChar(s.charAt(end))) {
			end++;
		}
		if (end >= s.length() || s.charAt(end) == ' ') {
			return end - begin;
		}
		return -1;
	}

	static boolean isLinkChar(char c) {
		return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '/'
				|| c == ':' || c == '.';
	}

	static BufferedReader br;
	static PrintWriter out;

	static void debug(Object... a) {
		System.err.println(deepToString(a));
	}

	public static void main(String[] args) {
		try {
			File file = new File("twi.in");
			InputStream input = System.in;
			OutputStream output = System.out;
			if (file.canRead()) {
				input = (new FileInputStream(file));
				output = (new PrintStream("twi.out"));
			}
			br = new BufferedReader(new InputStreamReader(input));
			out = new PrintWriter(output);
			solve();
			out.close();
			br.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}