#include <string>
#include <iostream>
#include <vector>
#include <fstream>

using namespace std;

int lcp(const string& s1, const string& s2)
{
    int i;
    for (i = 0; i < s1.size() && i < s2.size() && s1[i] == s2[i]; i++)
        ;
    return i;
}

int main()
{
    ifstream in("typewriter.in");
    ofstream out("typewriter.out");
    int n;
    in >> n;
    vector<string> s(n);
    for (int i = 0; i < n; i++)
        in >> s[i];
    int ans = s[0].size() + n - 1;
    for (int i = 1; i < n; i++)
        ans += min(s[i].size(), s[i].size() + s[i - 1].size() - 2 * lcp(s[i - 1], s[i]) + 1);
    out << ans << "\n";
}
