title: Number format exception for large inputs
body: <p>This code works fine for some inputs. 
  but I get a NumberFormatError for higher values of inputs such as 1000000.
  The input (taken for s[]) ranges from values 1-2000000
  What could be the reason?</p>
  
  <pre><code>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) {
          /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
  
         try
          {
           BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
  
           int no=Integer.parseInt(read.readLine());
  
           String s[]=read.readLine().split(" ");
  
           int result=0;
  
           for(int i=0; i&lt;no; i++)
           {
               result+= Integer.parseInt(s[i]);
               if(result&lt;0)
                   result=0;
           }
           System.out.println(result);
  
          }
          catch(IOException e)
         {
             System.out.println(e.getMessage());
         }
      }
  }
  </code></pre>