Language: Java

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int n = getInput().get(0);
        ArrayList<Integer> p = package com.company;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int n = getInput().get(0);
        ArrayList<Integer> p = getInput();

        int count = 0;
        for (int i = 0; i < p.size(); i++) {
            List<Integer> cut = p.subList(0, i);
            
            int max;
            if (cut.size() == 0) {
                ++count;
                continue;
            } else if (cut.size() == 1) {
                max = cut.get(0);
            } else {
                max = cut.stream().min(Comparator.naturalOrder()).get();
            }
            
            if (p.get(i) <= max) ++count;
        }

        Print(count);
    }

    private static Scanner scanner = new Scanner(System.in);

    private static ArrayList<Integer> getInput() {
        String in = scanner.nextLine();

        ArrayList<Integer> result = new ArrayList<>();
        for (String t : in.split(" ")) {
            result.add(Integer.parseInt(t));
        }

        return result;
    }

    private static void Print(Object o) {
        System.out.println(o);
    }

    private static void Print(Object... o) {
        for (Object i : o) System.out.print(i);
        System.out.println();
    }
}
getInput();

        int count = 0;
        for (int i = 0; i < p.size(); i++) {
            List<Integer> cut = p.subList(0, i);
            
            int max;
            if (cut.size() == 0) {
                ++count;
                continue;
            } else if (cut.size() == 1) {
                max = cut.get(0);
            } else {
                max = cut.stream().min(Comparator.naturalOrder()).get();
            }
            
            if (p.get(i) <= max) ++count;
        }

        Print(count);
    }

    private static Scanner scanner = new Scanner(System.in);

    private static ArrayList<Integer> getInput() {
        String in = scanner.nextLine();

        ArrayList<Integer> result = new ArrayList<>();
        for (String t : in.split(" ")) {
            result.add(Integer.parseInt(t));
        }

        return result;
    }

    private static void Print(Object o) {
        System.out.println(o);
    }

    private static void Print(Object... o) {
        for (Object i : o) System.out.print(i);
        System.out.println();
    }
}


Compiler output:
Main.java:9: error: illegal start of expression
        ArrayList<Integer> p = package com.company;
                               ^
Main.java:9: error: not a statement
        ArrayList<Integer> p = package com.company;
                                          ^
Main.java:11: error: illegal start of expression
import java.util.ArrayList;
^
Main.java:11: error: not a statement
import java.util.ArrayList;
                ^
Main.java:12: error: illegal start of expression
import java.util.Comparator;
^
Main.java:12: error: not a statement
import java.util.Comparator;
                ^
Main.java:13: error: illegal start of expression
import java.util.List;
^
Main.java:13: error: not a statement
import java.util.List;
                ^
Main.java:14: error: illegal start of expression
import java.util.Scanner;
^
Main.java:14: error: not a statement
import java.util.Scanner;
                ^
Main.java:16: error: illegal start of expression
public class Main {
^
Main.java:63: error: invalid method declaration; return type required
getInput();
^
Main.java:66: error: illegal start of type
        for (int i = 0; i < p.size(); i++) {
        ^
Main.java:66: error: > or ',' expected
        for (int i = 0; i < p.size(); i++) {
                                  ^
Main.java:66: error: <identifier> expected
        for (int i = 0; i < p.size(); i++) {
                                       ^
Main.java:82: error: invalid method declaration; return type required
        Print(count);
        ^
Main.java:82: error: <identifier> expected
        Print(count);
                   ^
Main.java:85: error: unnamed classes are a preview feature and are disabled by default.
    private static Scanner scanner = new Scanner(System.in);
                   ^
  (use --enable-preview to enable unnamed classes)
Main.java:106: error: class, interface, enum, or record expected
}
^
19 errors