N = int(input())
H = list(input())
ans = 1
for i in range(1,len(H)):
  if H[i-1]<=H[i]:
    flag = 0
    for j in range(i):
      if H[i]<H[j]:
        flag=1
    if flag != 1:
      ans+=1
print(ans)