def sums(n)
  return n*(n+1)/2
end

s = gets.chomp.split("")
cmps = Array.new(0)
mark = Array.new(0)

cnt = 1
pre = s[0]
for i in 1..(s.length-1)
  if s[i] == pre
    cnt += 1
  else
    cmps.push(cnt)
    mark.push(pre)
    cnt = 1
  end
  pre = s[i]
end
cmps.push(cnt)
mark.push(pre)

ans = 0
if mark[0] == ">"
  ans += cmps[0]
end
for i in 0..(cmps.length-2)
  if mark[i] == "<"
    ans += [cmps[i],cmps[i+1]].max
  end
end
if mark[cmps.length-1] == "<"
  ans += cmps[cmps.length-1]
end
for i in 0..(cmps.length-1)
  ans += sums(cmps[i]-1)
end
puts ans