import java.io.PrintWriter

fun main(args: Array<String>) {
    PrintWriter(System.out).use { out ->
        solve(out)
        out.flush()
    }
}

fun solve(out: PrintWriter) {
    val s = readLine()!!
    val partList = mutableListOf<String>()
    var left = 0
    var right = 1
    while (left < s.length) {
        while (right < s.length && (s[right - 1] != '>' || s[right] != '<')) {
            right++
        }

        partList += s.substring(left, right)

        if (right == s.length) {
            break
        }

        left = right
        right++
    }

    var ans = 0L
    for (s in partList) {
        val tmp1 = s.count { it == '<' }
        val tmp2 = s.count { it == '>' }
        val max = Math.max(tmp1, tmp2) + 0L
        val min  = Math.min(tmp1, tmp2) - 1L
        ans += max * (max + 1) / 2 + min * (min + 1) / 2
    }

    println(ans)
}

//0 <3>2>1> 0 <1<2> 0 <1<2<3<4<5>2>1> 0 < 1

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
fun readDoubleList() = readStringList().map(String::toDouble)
