fun main(args:Array<String>?): Unit {
    val n = readLine()!!.trim().toInt()
    val panels = readLine()!!.trim()
    val rightArrow = IntArray(n){if (panels[it] == '>') 1 else 0}
    val leftArrow = IntArray(n){if (panels[it] == '<') 1 else 0}
    for (i in 1 until n) {
        rightArrow[i] += rightArrow[i - 1]
        leftArrow[n - i - 1] += leftArrow[n - i]
    }
    println((0 until n).map{mid ->
        if (rightArrow[mid] == leftArrow[mid]) if (panels[mid] == '<') n - lowerBoundAsc(rightArrow, 1) else upperBoundDec(leftArrow, 1)
        else if (rightArrow[mid] > leftArrow[mid]) n - lowerBoundAsc(rightArrow, rightArrow[mid] - leftArrow[mid] + (if (panels[mid] == '>') 0 else 1))
        else upperBoundDec(leftArrow, leftArrow[mid] - rightArrow[mid] + (if (panels[mid] == '<') 0 else 1))
    }.max())
}
fun lowerBoundAsc(array: IntArray, target: Int): Int {
    var left = 0
    var right = array.size
    while(left < right){
        val mid = (left + right) / 2
        if (array[mid] < target) left = mid + 1
        else right = mid
    }
    return right
}
fun upperBoundDec(array: IntArray, target: Int): Int {
    var left = 0
    var right = array.size
    while(left < right){
        val mid = (left + right) / 2
        if (array[mid] >= target) left = mid + 1
        else right = mid
    }
    return right
}
