S = gets.chomp
T = S[0]!=?< ? '<'+S : S
s = p0 = 0
until p0 == T.size
	p1 = T.index('>', p0)||T.size
	p2 = T.index('<', p1)||T.size
	l, r = p1-p0, p2-p1
	s += l*(l+1) + r*(r+1) - 2*(l<r ? l : r)
	p0 = p2
end
p s/2
