#include <iostream>

using namespace std;

int main()
{
    int resenje=0;
    int x1,y1,x2,y2;
    cout<<"Unesite kordinate prve tacke: "<<endl;
    cout<<"X1 = ";
    cin>>x1;
    cout<<"Y1 = ";
    cin>>y1;
    cout<<endl;

    cout<<"Unesite kordinate druge tacke: "<<endl;
    cout<<"X2 = ";
    cin>>x2;
    cout<<"Y2 = ";
    cin>>y2;

    if(((x1==x2)&&(y1!=y2))||((y1==y2)&&(x1!=x2))){
        resenje = 2;
    }
    if((x1==x2)&&(y1==y2)){
        resenje = 4;
    }
    if(x1<x2){
        if(y1<y2){
                if((x2-x1)==(y2-y1)){
                    resenje = 1;
                }
            }else{
                  if((x2-x1)==(y1-y2)){
                    resenje = 1;
                }
            }
    }else if(x2<x1){
        if(y1<y2){
                 if((x1-x2)==(y2-y1)){
                    resenje = 1;
                }
            }else{
                  if((x1-x2)==(y1-y2)){
                    resenje = 1;
                }
            }
    }

    cout<<resenje;

    return 0;
}