fun main(args: Array<String>) {
    val s = readLine()!!
    val n = s.length + 1
    val leftArray = Array(n) { 0L }
    val rightArray = Array(n) { 0L }
    var c = 0L
    (1 until n).forEach {
        c = if (s[it - 1] == '<') c + 1 else 0
        leftArray[it] = c
    }
    c = 0L
    (n - 2 downTo 0).forEach {
        c = if (s[it] == '>') c + 1 else 0
        rightArray[it] = c
    }
    println((0 until n).map { Math.max(leftArray[it], rightArray[it]) }.sum())
}