x,y,z=gets.split.map(&:to_i) puts z - (z<=y ? 1 : 0) - (z<=x ? 1 : 0)