<pre>import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Owl {
	static String line;

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while (!(line = br.readLine()).equals(&quot;END&quot;)) {
			int index = line.length() - 1;
			for (int i = line.length() - 1; i &gt;= 0; i--) {
				if (line.charAt(i) != '0') {
					index = i;
					break;
				}
			}
			System.out.println(Integer.parseInt(line.substring(0, index)
					+ (Integer.parseInt(&quot;&quot; + line.charAt(index)) - 1) + line.substring(index + 1, line.length())));
		}
	}
}
</pre>
