package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func splitStr(str string) []int {
	strList := strings.Split(str, "")
	res := make([]int, len(strList))
	for i := 0; i < len(strList); i++ {
		res[i], _ = strconv.Atoi(strList[i])
	}
	return res
}

func main() {
	var n int
	fmt.Scan(&n)
	numList := splitStr(nextLine())
	looksHotel := 0
	max := 0
	for _, num := range numList {
		if max <= num {
			looksHotel++
			max = num
		}
	}
	fmt.Println(looksHotel)
}
