Submit solution

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

Authors:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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 substring java.

Input Specification

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

Output Specification

The number of characters before the first letter of the first occurrence of the substring java. If the substring 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.