local S = io.read()
local a = {}
a[#S+1] = 0
for i=#S,1,-1 do
  local c = S:sub(i,i)
  if c == '>' then
    a[i] = a[i+1] + 1
  else
    a[i] = 0
  end
end
for i=1,#S do
  local c = S:sub(i,i)
  if c == '<' and a[i+1] <= a[i] then
    a[i+1] = a[i] + 1
  end
end
local s = 0
for i=1,#a do
  s = s + a[i]
end
print(s)
