#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int main()
{
	FILE *fin;
	FILE *fout;
	fin=fopen("input.txt","r");
	fout=fopen("output.txt","w");
	int in;
	int current=-1;
	int count=0;
	int k;
	char str[20];
	int i;
	int j=0;
	int m;
	int b=1;
	while(b)
	{
	fgets(str,9, fin);
	if(feof(fin)) b=0;
	in=atoi(str);
	m=strlen(str)-1;
	str[0]='\0';
	for(i=pow(10.0,m);i>=1;i/=10)
	{
		k=(((in/i)*i)%(i*10))/i;
		if(k==current) count+=10;
		else
		{
			if(j==0)	
			{
				current=k;
				j++;
				count=10;
			}
			else
			{	
				count+=current;
				fprintf(fout,"%d",count);
				count=10;
				current=k;
			}
		}
	}
	}
	count+=current;
	if(count>-1)
		fprintf(fout,"%d",count);
	fclose(fin);
	fclose(fout);
	return 0;
}