#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

//#define TESTPATH "H:\\F\\Debug\\"
#define TESTPATH ""

int main(void)
{
	FILE * inf = fopen(TESTPATH"input.txt", "rt");
	FILE * outf = fopen(TESTPATH"output.txt", "wt");

	char s1[256],
		 s2[256];

	int N, total;

	fscanf(inf, "%d", &N);

	if (N != 0) {
		fscanf(inf, "%s", s1);
	}

	total = strlen(s1);
	for (int t = 1; t < N; t++) {
		fscanf(inf, "%s", s2);		

		//Analyze
		int j, minj;
		int ls1 = strlen(s1), ls2 = strlen(s2);
		minj = ls1 > ls2 ? ls2 : ls1;

		for (j = 0; j < minj && s1[j] == s2[j]; j++);

		total += ls2 - j + 1;

		strcpy(s1, s2);
	}

	fprintf(outf, "%d", total);
	
	fclose(inf);
	fclose(outf);
	return 0;
}