#include <iostream>
#include <vector>
#include <algorithm>

using ll = long long;
/* inline */ constexpr auto EPS = 1e-9;

template <typename T, typename U>
inline constexpr auto strict__ (U && x) noexcept -> U
{
  static_assert (std::is_same <T, std::decay_t <U>>::value, "strict type check error");
  return std::forward <U> (x);
}

#define REP(n) for (decltype (n) i = 0, len__ = (n); i < len__; ++ i)
#define ALL(x) x.begin (), x.end ()
#define PRINT(x) std::cout << #x << " = " << x << std::endl;

// C++17
/* 
template <unsigned R, typename Iterator, typename F, typename ... Ts>
auto combination (Iterator begin, Iterator end, F callback, Ts && ... results) -> void
{
  if constexpr (R == 0u)
  {
    callback (std::forward <Ts> (results) ...);
  }
  else
  {
    for (auto ite = begin; ite < end; ++ ite)
    {
      combination <R - 1> (ite + 1, end, callback, std::forward <Ts> (results) ..., * ite);
    }
  }
}
*/

// C++14 version
namespace detail
{
  template <unsigned r>
  struct combination_helper
  {
    template <typename Iterator, typename F, typename ... Ts>
    static constexpr auto f (Iterator begin, Iterator end, F callback, Ts && ... results) -> void
    {
      for (auto ite = begin; ite < end; ++ ite)
      {
        combination_helper <r - 1>::f (ite + 1, end, callback, std::forward <Ts> (results) ..., * ite);
      }
    }
  };
  template <>
  struct combination_helper <0u>
  {
    template <typename Iterator, typename F, typename ... Ts>
    static constexpr auto f (Iterator, Iterator, F callback, Ts && ... results) -> void
    {
      callback (std::forward <Ts> (results) ...);
    }
  };
} // namespace detail

template <unsigned r, typename Iterator, typename F>
auto combination (Iterator begin, Iterator end, F callback) -> void
{
  return detail::combination_helper <r>::f (begin, end, callback);
}


struct Pos
{
  int x, y;
  friend auto operator << (std::ostream & stream, const Pos & p) -> decltype ((stream))
  {
    return stream << "(" << p.x << ", " << p.y << ")";
  }
};


auto calc (int dx, int dy, const std::vector <Pos> & ps)
{
  auto now = ps [0];
  bool picked [51] = {true};
  auto cost = 1;
  
  // 残りボールが0になるまでループ
  for (auto restball = ps.size () - 1; restball > 0; -- restball)
  {
    //PRINT (now);

    // no cost move
    REP (ps.size ())
    {
      if (! picked [i] && now.x + dx == ps [i].x && now.y + dy == ps [i].y)
      {
        picked [i] = true;
        now = ps [i];
        goto nextball;
      }
    }

    // cost 1
    REP (ps.size ())
    {
      if (! picked [i])
      {
        picked [i] = true;
        ++ cost;
        now = ps [i];
        goto nextball;
      }
    }
  nextball:
    ;
  }
  return cost;
}



auto main () -> int
{
  std::cin.tie (nullptr);
  std::ios::sync_with_stdio (false);

  int n;
  std::cin >> n;
  std::vector <Pos> ps;
  REP (n)
  {
    int x, y;
    std::cin >> x >> y;
    ps.push_back (Pos {x, y});
  }
  
  std::sort (ALL (ps), [] (const Pos & p1, const Pos & p2) {
    return p1.y == p2.y ? p1.x < p2.x : p1.y < p2.y;
  });
  
  int ans = n == 1 ? 1 : 10000;
  combination <2> (ALL (ps), [&] (auto && p1, auto && p2) {
    //PRINT (p1);
    //PRINT (p2);
    
    auto p = p2.x - p1.x;
    auto q = p2.y - p1.y;
    auto cost = calc (p, q, ps);
    //PRINT (cost); std::cout << std::endl;
    ans = std::min (ans, cost);
  });
  
  std::cout << ans << std::endl;
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/


Measured memory_bytes: 256