import numpy as np

number_of_mt=int(input())
a=list(input())
sum=1

for i in range(number_of_mt+1):
  if a[i]:
    for j in range(i):
      if a[i]<a[j]:
        break
      elif a[i]>=a[j] and i-1==j:
        sum+=1
      else:
        continue
      
print(sum)