local s = io.read()
local n = #s + 1
local llen, rlen = 0, 0
local toup = true
local lpos = s:sub(1, 1) == ">" and 0 or 1
local turnpos = 0
local sum = 0
if s:sub(n - 1, n - 1) == "<" then
  s = s .. ">"
else
  s = s .. "<"
end
for i = 1, n do
  local ss = s:sub(i, i)
  if ss == "<" then
    if not toup then
      local rlen = i - turnpos
      if llen < rlen then
        sum = sum + llen * (llen - 1) // 2 + rlen * (rlen + 1) // 2
      else
        sum = sum + llen * (llen + 1) // 2 + rlen * (rlen - 1) // 2
      end
      -- print(sum)
      lpos = i
      toup = true
    end
  else
    if toup then
      turnpos = i
      llen = i - lpos
      toup = false
    end
  end
end
if not toup then
  local rlen = n - turnpos
  -- print(rlen)
  if llen < rlen then
    sum = sum + llen * (llen - 1) // 2 + rlen * (rlen + 1) // 2
  else
    sum = sum + llen * (llen + 1) // 2 + rlen * (rlen - 1) // 2
  end
end
print(sum)
