/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 *
 * @author tym10
 */
public class Owl {

    /**
     * @param args the command line arguments
     * @throws java.io.IOException
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
           int i;
        long nr;
        char [] buffer;
        //char* ret = fgets(buffer, 7, stdin);
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        buffer = in.readLine().toCharArray();
        while (!(Arrays.equals(buffer, "END".toCharArray()))) {
                for (i = buffer.length-1; i >= 0; i--) {
                    if (buffer[i] != '0' && buffer[i] != '\0' && buffer[i] != '\n') { 
                        buffer[i] = (char)(buffer[i] - (char)1);
                        
                                break;
                        }
                }
                nr = Integer.parseInt(String.copyValueOf(buffer));
                System.out.println(nr);
                buffer = in.readLine().toCharArray();
        }

        
    }
    
}