import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int s = in.nextInt(); String steps = in.next(); int lvl = 0; int val = 0; for (int i=0; i