Help me in this Error Number Format EXception for ""

Here is the code
import java.util.;
public class Main {
static int convert(String n){
if(n.equals("")){
return 0;
}
int x =1;
for(int i=0;i<n.length()-1;i++){
x = x
10;
}
x = x*Integer.parseInt(n.substring(0,1));
return x + Integer.parseInt(n.substring(0,1));

}
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String n = sc.next();
convert(n);

}

}

Can you please look at the code ?? where it is wrong??