fun main(arr: Array<String>) {
    val s = readLine()!!
    val nobori = IntArray(s.length + 1)
    val kudari = IntArray(s.length + 1)
    nobori[0] = 0
    for(i in (1 until nobori.size)) {
        if(s[i - 1] == '<') {
            nobori[i] = nobori[i-1] + 1
        } else {
            nobori[i] = 0
        }
    }
    kudari[kudari.lastIndex] = 0
    for(i in (0 until kudari.size - 1).reversed()) {
        if(s[i] == '>') {
            kudari[i] = kudari[i+1] + 1
        } else {
            kudari[i] = 0
        }
    }
    val ans = nobori.indices.map { Math.max(nobori[it] , kudari[it]).toLong() }.sum()
    println(ans)
}

