#include <iostream>
#include <vector>
#include <set>
#include <fstream>
class Rectangle {
private:
int a1;
int b1;
int a2;
int b2;
public:
Rectangle();
Rectangle(int a1, int b1, int a2, int b2);
int getA1();
int getB1();
int getA2();
int getB2();
void setA1(int newA1);
void setB1(int newB1);
void setA2(int newA2);
void setB2(int newB2);
int getPerimeter();
};
Rectangle::Rectangle() {
a1 = 0;
b1 = 0;
a2 = 0;
b2 = 0;
}
Rectangle::Rectangle(int a1, int b1, int a2, int b2) {
this->b1 = b1;
this->a1 = a1;
this->a2 = a2;
this->b2 = b2;
}
int Rectangle::getA1() {
return a1;
}
int Rectangle::getB1() {
return b1;
}
int Rectangle::getA2() {
return a2;
}
int Rectangle::getB2() {
return b2;
}
void Rectangle::setA1(int newA1) {
a1 = newA1;
}
void Rectangle::setB1(int newB1) {
b1 = newB1;
}
void Rectangle::setA2(int newA2) {
a2 = newA2;
}
void Rectangle::setB2(int newB2) {
b2 = newB2;
}
int Rectangle::getPerimeter() {
return 2 * (abs(a1 - a2) + abs(b1 - b2));
}
int main() {
std::ifstream fin("in.txt");
std::ofstream fout("out.txt");
int n;
fin >> n;
std::vector <Rectangle> r;
for (int i = 0; i < n; i++) {
int a1, b1, a2, b2;
fin >> a1 >> b1 >> a2 >> b2;
r.push_back(Rectangle(a1, b1, a2, b2));
}
std::set <int> s;
for (int i = 0; i < n; i++) {
s.insert(r[i].getPerimeter());
}
fout << s.size();
fin.close();
fout.close();
return 0;
}