N = int(input()) genga = list(map(int, input().split())) #print(genga) genga_sorted = sorted(genga) #print(genga_sorted) end_index = genga_sorted.index(genga[0]) print(end_index)