using System;
public class Program
{
public static void Main()
{
//0xFFFF00(5050) + 0xFF(100)
int x = 100;
for (; (x & 0xFF) > 0; x= x & 0xFFFF00 | ((x & 0xFF) -1))
{
x = ((x >> 8) + (x & 0xFF)) << 8 | (x & 0xFF);
}
Console.WriteLine(x>>8);
}
}
dXNpbmcgU3lzdGVtOwpwdWJsaWMgY2xhc3MgUHJvZ3JhbQp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICB7CiAgICAgICAgLy8weEZGRkYwMCg1MDUwKSArIDB4RkYoMTAwKQogICAgICAgIGludCB4ID0gMTAwOwogICAgICAgIGZvciAoOyAoeCAmIDB4RkYpID4gMDsgeD0gIHggJiAweEZGRkYwMCB8ICgoeCAmIDB4RkYpIC0xKSkKICAgICAgICB7CiAgICAgICAgICAgIHggPSAoKHggPj4gOCkgKyAoeCAmIDB4RkYpKSA8PCA4IHwgKHggJiAweEZGKTsKICAgICAgICB9CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoeD4+OCk7CiAgICB9Cn0=