puts gets.split.map(&:to_i).each_slice(2).map{|a,b|(a..b).to_a}.inject(&:product).count{|a,b|a!=b}