def max(a,b); a > b ? a : b; end
S = gets.chomp
dp = Array.new(S.size + 1, 0)
(1 .. S.size).inject(0) do |ld, i|
  dp[i] = (S[i - 1] == '<' ? ld + 1 : 0)
end
(1 .. S.size).inject(0) do |rd, i|
  (S[-i] == '>' ? rd + 1 : 0).tap do |rd_|
    dp[-i - 1] = max(dp[-i - 1], rd_)
  end
end
puts dp.inject(0,&:+)
