s = gets.chomp.chars
n = s.size

ans = [0]*(n+1)

i = 0
while i < n
  if s[i] == '<'
    while i < n && s[i] == '<' # 右にある<を数える
      ans[i+1] = ans[i] + 1
      i += 1
    end
  else
    i += 1
  end
end

i = n-1
while i >= 0
  if s[i] == '>'
    while i >= 0 && s[i] == '>'
      ans[i] = [ans[i+1] + 1, ans[i]].max
      i -= 1
    end
  else
    i -= 1
  end
end

print ans.inject(:+)