# your code goes here
def takeIndex (str, c, index):
	count = 0
	for i in range(len(str)):
		if (str[i] == c):
			count += 1
			if (count == index):
				return i
	if (count == 0):
		return -1

a = "quan tri mang cham com"
print (takeIndex(a, 'a', 2))