string source = "1654172703390231363193871214409827255040536632558212919751502330593116592777";
string result = "";
bool change = true;
foreach(char c in source.Reverse()){
if(change){
int num = int.Parse(c.ToString());
if(num > 0){
result = result.Insert(0, (num - 1).ToString());
change = false;
}
else result = result.Insert(0, "9");
}
else{
result = result.Insert(0, c.ToString());
}
}
if(result.First() == '0'){
result = result.Remove(0, 1);
}
return result;