x,y,z = gets.split.map(&:to_i) p z - [x,y,z].sort.rindex(z)