import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String S = in.next();
        try {            
            System.out.println(Integer.parseInt(S));
        } catch (Exception ex) {
            System.out.println("Bad String");
        }
    }
}

Create Day_16_Exceptions_String_to_Integer.java