def max(a,b); a > b ? a : b; end
S = gets.chomp; N = S.size + 1
L = Array.new(N, 0)
R = Array.new(N, 0)
(1 .. N).each do |i|
  L[i] = (S[i] == '<' ? L[i - 1] + 1 : 0)
  R[N - 1 - i] = (S[N - i] == '>' ? R[N - i] + 1 : 0)
end
ans = N.times.inject(0) do |sum, i|
  sum += max(L[i],R[i])
end
puts ans
