//filename: Main.java //no package import java.util.Scanner; //some problems require bufferedReader due to a lot of IO, but scanner's usually fine //reference for buffered IO: https://onlinejudge.org/data/p100.java.html class Main{ //class should be named Main //class should not be public, I don't know why //having multiple classes is fine public static void main(String args[]){ Scanner scan = new Scanner(System.in); //use System.in regardless of the program mentioning an input file or not int n = scan.nextInt(); //scan stuff System.out.println(3*n+1); //print stuff scan.close(); //you seemingly don't have to close the scanner //because I constantly forget to and it's still accepted //to stop program just have method finish //or System.exit(0); } }