print sum(sorted(map(int,raw_input()))[1:5])/4.0