#include <iostream>
using namespace std;
const int TEN = 10;
int main() {
int n, x, currentDigit;
cin >> n >> x;
while (cin >> currentDigit) {
if (currentDigit == 1) {
++n;
} else {
n *= TEN;
}
}
cout << n;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmNvbnN0IGludCBURU4gPSAxMDsKIAppbnQgbWFpbigpIHsKCWludCBuLCB4LCBjdXJyZW50RGlnaXQ7CgljaW4gPj4gbiA+PiB4OwoJd2hpbGUgKGNpbiA+PiBjdXJyZW50RGlnaXQpIHsKCQlpZiAoY3VycmVudERpZ2l0ID09IDEpIHsKCQkJKytuOwoJCX0gZWxzZSB7CgkJCW4gKj0gVEVOOwoJCX0KCX0KCWNvdXQgPDwgbjsKCXJldHVybiAwOwp9