import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
public class learn {
public static int jj = 0;
public static void main(String args[]){
int n =2;
int res=1;
while(getarray(n)+res!=n){
res= res+getarray(n);
n++;
}
System.out.println(n+"----------"+getarray(n)+res);
}
public static int getarray(int n){
int num=0;
String hh = n+"";
for(int i=0;i<hh.length();i++){
if(hh.charAt(i)=='1'){
++num;
}
}
return num;
}
}