#include <iostream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char c[105];
int a[105];
int sum[105];
int main()
{
memset(sum, 0, sizeof(sum));
int set = 0;
while(~scanf("%s",c))
{
if(c[0] == '0')
break;
int len = strlen(c);
int cnt = 0;
memset(a, 0, sizeof(a));
for( int i = len - 1; i >= 0; i--)
a[++cnt] = c[i] - '0';
set = max(set, cnt);
int cset = 0;
for( int i = 1; i <= set; i++)
{
sum[i] = sum[i] + cset + a[i];
cset = sum[i]/10;
sum[i] %= 10;
}
if(cset)
sum[++set] = cset;
}
for( int i = set; i >= 1; i--)
cout<<sum[i];
cout<<endl;
}
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char c[105];
int a[105];
int sum[105];
int main()
{
memset(sum, 0, sizeof(sum));
int set = 0;
while(~scanf("%s",c))
{
if(c[0] == '0')
break;
int len = strlen(c);
int cnt = 0;
memset(a, 0, sizeof(a));
for( int i = len - 1; i >= 0; i--)
a[++cnt] = c[i] - '0';
set = max(set, cnt);
int cset = 0;
for( int i = 1; i <= set; i++)
{
sum[i] = sum[i] + cset + a[i];
cset = sum[i]/10;
sum[i] %= 10;
}
if(cset)
sum[++set] = cset;
}
for( int i = set; i >= 1; i--)
cout<<sum[i];
cout<<endl;
}