import kotlin.math.max
import kotlin.math.min

fun main(args: Array<String>) {
    val regex = Regex("<*>*")
    val s = regex.findAll(readString()).map { it.value }.toList()

    var ans = 0L
    s.forEach {
        val gt = it.count { it == '<' }
        val lt = it.count { it == '>' }

        for (i in 0..max(gt, lt)) {
            ans += i
        }
        for (i in 0 until min(gt, lt)) {
            ans += i
        }
    }
    println(ans)
}

// Tools
fun readString() = readLine()!!