#import <Foundation/Foundation.h>
int main() {
	char prev = '\0';
	int current = 0;
	NSMutableArray *list = [NSMutableArray array];
	char c;
	while((c=getchar())!='\n'){
		if(c=='<'){
			if(prev==c){
				current++;
			}else{
				if(prev!='\0') [list addObject:@(current)];
				current = 1;
			}
		}else{
			if(prev==c){
				current--;
			}else{
				if(prev!='\0') [list addObject:@(current)];
				current = -1;
			}
		}
		prev = c;
	}
	[list addObject:@(current)];
	NSMutableArray *ans = [NSMutableArray array];
	current = 0;
	for(NSNumber *value in list){
		int val = [value intValue];
		if(val > 0){
			for(;current<=val;current++){
				[ans addObject:@(current)];
			}
			current=val;
		}else{
			val = ABS(val);
			if(val>current) {
				if([ans count]>0){
					[ans replaceObjectAtIndex:[ans count]-1 withObject:@(val)];
				}else{
					[ans addObject:@(val)];
				}
			}
			current = val-1;
			for(;current>=0;current--){
				[ans addObject:@(current)];
			}
			current = 0;
		}
	}
	printf("%ld\n", [[ans valueForKeyPath:@"@sum.self"] integerValue]);
}
