Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type

Syed likes Java. In fact, he likes Java so much, that he can’t help but try to insert it into everything he writes. Syed has typed out a string of lowercase characters for his essay - since he is such a grand master at writing English essays, he does not need ridiculous things like correct grammar, spaces, capitalization, or any form of punctuation to communicate his incredibly deep ideas. Find the number of characters before the first letter of the first occurrence of the sub-string ‘java’.

Input Specifications

A single string of lowercase letters that is up to 1,000 characters long on a single line.

Output Specifications

The number of characters before the first letter of the first occurrence of the sub-string java. If the sub-string java does not occur, output the length of the string instead.

Sample Input 1

ilikejava

Sample Output 1

5

Sample Input 2

javaisbestlang

Sample Output 2

0

Sample Input 3

onehundredinenglishbtw

Sample Output 3

22

Comments

There are no comments at the moment.