#include [[nodiscard]] static inline constexpr uint_fast32_t solve([[maybe_unused]] const uint_fast32_t N, const std::vector>& drops) noexcept { std::array count_of = { 0, }; for (const auto& [a, b, c] : drops) ++count_of[a], ++count_of[b], ++count_of[c]; uint_fast32_t ans = 0; for (auto& c : count_of) ans += c / 2, c %= 2; return ans + std::accumulate(count_of.begin(), count_of.end(), UINT32_C(0)) / 4; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); uint_fast32_t N; std::cin >> N; std::vector> drops(N); for (auto& [a, b, c] : drops) std::cin >> a >> b >> c; std::cout << solve(N, drops) << '\n'; return 0; }