/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public int firstUniqueChar(String str) {

    int index = -1;
    str = str.toLowerCase();

    Map<Character, Integer> charFreqMap = new HashMap<>();

    // Update the map
    for (int i = 0; i < str.length(); i++) {
      char c = str.charAt(i);

      // Get the current frequency
      int freq = charFreqMap.getOrDefault(c, 0);

      // Update the map
      charFreqMap.put(c, (freq + 1));
    }

    for (int i = 0; i < str.length(); i++) {
      if (charFreqMap.get(str.charAt(i)) == 1) {
        index = i;
        break;
      }
    }

    return index;
  }
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Ideone x = new Ideone();
		System.out.println(x.firstUniqueChar("lotsOfLove"));
	}
}