title: I want to take string and integer together so that if user enters add y then it perform add and if set x then initialize the value
body: <pre><code>import java.io.*;
  import java.math.*;
  import java.text.*;
  import java.util.*;
  import java.util.regex.*;
  ​
  public class Solution {
  ​
      static long maximumProgramValue(int n) {
          long x=0l,y=0l;
          long count=0l;
          while(n!=0) {
              String s=scanner.nextLine();
              if(s.next().equals("add")) {
                  y=s.nextLong();
                  x=x+y;
              } else {
                  y=s.nextLong();
              }
              if(count &lt; x)
              count=x;
              n--;
          }
          return count ;
      }
      ​
      private static final Scanner scanner = new Scanner(System.in);
      ​
      public static void main(String[] args) throws IOException {
          BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
          int n = scanner.nextInt();
          scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])*");
          long result = maximumProgramValue(n);
          bufferedWriter.write(String.valueOf(result));
          bufferedWriter.newLine();
          bufferedWriter.close();
          scanner.close();
      }
  }
  </code></pre>
  
  <p>​
  I am getting this error please help</p>
  
  <pre><code>Solution.java:21: error: cannot find symbol
              if(s.next().equals("add"))
                  ^
    symbol:   method next()
    location: variable s of type String
  Solution.java:23: error: cannot find symbol
                  y=s.nextLong();
                     ^
    symbol:   method nextLong()
    location: variable s of type String
  Solution.java:28: error: cannot find symbol
                y=s.nextLong();   
                   ^
    symbol:   method nextLong()
    location: variable s of type String
  3 errors
  Exit Status
  </code></pre>