I am very new to java and I was wondering if you could help me out. Here is my code:

```
public static void main(String[] args) {

    int vowels = 0;

    Scanner input = new Scanner(System.in);

    System.out.println ("Enter a string: ");
        String string = input.nextLine();

    int length = string.length();

for (int i = 0; i <= length; i++) {

    String letter = string.substring(i, ++i);

    if (letter.equalsIgnoreCase("a")){vowels++;}    
    if (letter.equalsIgnoreCase("e")){vowels++;}
    if (letter.equalsIgnoreCase("i")){vowels++;}
    if (letter.equalsIgnoreCase("o")){vowels++;}
    if (letter.equalsIgnoreCase("u")){vowels++;}

}
    System.out.println ("The number of vowels in " + string + " is: " + vowels);
}

```

The number is off but I can't figure out why.