#include <stdio.h>
#include <cmath>
int f(int a);
int a[11] = {0};
int main(int argc, char *argv[]) {
int n;
scanf("%d", &n);
int i, j;
int cnt = 0;
int tmp = n;
while (tmp > 0) {
tmp = tmp / 10;
cnt++;
}
tmp = n;
i = 0;
while (tmp > 0) {
a[i++] = tmp % 10;
tmp = tmp / 10;
}
int sum = 0;
for (i = 0; i < cnt; i++) {
if (a[i] > 1) {
sum += a[i] * f(i) + pow(10, i);
} else if (a[i] == 1) {
int r = 0;
for (j = 0; j < i; j++) {
r += a[j] * pow(10, j);
}
r++;
sum += 1 * f(i) + r;
}
}
printf("%d\n", sum);
return 0;
}
int f(int i) {
if (i == 0) return 0;
if (i == 1) return 1;
else return (pow(10, i - 1) + 10 * f(i - 1));
}