#include <iostream>
using namespace std;
int main() {
int t[] = { 8, 4, 3, 2, 1 }, i;
for(i = t[4]; i < t[0]; i++)
t[i - 1] = -t[3];
cout << i;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKICAgICAgICBpbnQgdFtdID0geyA4LCA0LCAzLCAyLCAxIH0sIGk7CiAgICAgICAgZm9yKGkgPSB0WzRdOyBpIDwgdFswXTsgaSsrKQogICAgICAgICAgICB0W2kgLSAxXSA9IC10WzNdOwogICAgICAgIGNvdXQgPDwgaTsKICAgICAgICByZXR1cm4gMDsKfQoK