7386: ABC276 —— A - Rightmost
[Creator : ]
Description
You are given a string S consisting of lowercase English letters.
If a appears in S, print the last index at which it appears; otherwise, print -1. (The index starts at 1.)
If a appears in S, print the last index at which it appears; otherwise, print -1. (The index starts at 1.)
Input
The input is given from Standard Input in the following format:
$S$
$S$
Output
Print the answer.
Constraints
S is a string of length between 1 and 100 (inclusive) consisting of lowercase English letters.
Sample 1 Input
abcdaxayz
Sample 1 Output
7
a appears three times in S. The last occurrence is at index 7, so you should print 7.
Sample 2 Input
bcbbbz
Sample 2 Output
-1
a does not appear in S, so you should print -1.
Sample 3 Input
aaaaa
Sample 3 Output
5