n = gets.to_i
xys = []
n.times{
  x, y = gets.split.map(&:to_i)
  xys << {x: x, y: y}
}
x = -99999;y = -99999;cost = 0
for i in (0..(xys.length-2)) do
  x_ = xys[i][:x] - xys[i+1][:x]
  y_ = xys[i][:y] - xys[i+1][:y]
  if x != x_ || y != y_
    cost+=1
    x = x_; y = y_
  end
end
puts cost