#include <stdio.h>

int strsize(char *s){
	for(int i=0;s[i]&&s[i]!='\n';i++);;
	return i;
}



int main(void){
	FILE *in,*o;
	in = fopen("input.txt","r");
	o = fopen("output.txt","w");

	int n;
	char s[2][257];
	int s_i=0;
	int total=0;
	fscanf(in,"%d",&n);
	fscanf(in,"\n");
	fgets(s[s_i],257,in);
	total+=strsize(s[s_i]);
	s_i=1;	int i=1;
	while(i<n){
		fgets(s[s_i],257,in);
		int k=0;
		int sz1 = strsize(s[s_i^1]);
		int sz2 = strsize(s[s_i]);
		for(;(s[s_i^1][k]==s[s_i][k])&&(k<sz1)&&(k<sz2);k++);;
		total+=(strsize(s[s_i]))-k+1;
//		printf("string0:%d, string1:%d similiar:%d, str1_compressd:%d\n",strsize(s[s_i^1]),strsize(s[s_i]),k,(strsize(s[s_i]))-k+1);
		s_i^=1;
		i++;
	}
	fprintf(o,"%d",total);
	fclose(in);
	fclose(o);
	return 0;
}