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

public class typewriter_ats implements Runnable {
    StringTokenizer st;
    PrintWriter out;
    BufferedReader br;

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

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

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

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

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

    private void solve() throws IOException {
        int n = nextInt();
        int ans = n - 1;
        String prev = nextToken();
        ans += prev.length();
        for (int j = 1; j < n; j++) {
            String cur = nextToken();
            int minVal = cur.length();
            int eqPref = 0;
            for (int i = 0; i < Math.min(cur.length(), prev.length()); i++) {
                if (cur.charAt(i) != prev.charAt(i)) {
                    break;
                }
                eqPref++;
            }
            minVal = Math.min(minVal, cur.length() + prev.length() - 2 * eqPref + 1);
            ans += minVal;
            prev = cur;
        }
        out.println(ans);
    }

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

            solve();

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