//KZNS
#include <cstdio>
#include <set>
#include <utility>
using namespace std;
typedef pair<int, int> pr;
set<pr> st;
int input() {
int f = 1;
int a = 0;
char c = getchar();
while (!(c == '-' || ('0' <= c && c <= '9')))
c = getchar();
if (c == '-') {
f = -1;
c = getchar();
}
while ('0' <= c && c <= '9') {
a = a * 10 + c - '0';
c = getchar();
}
return a * f;
}
int main() {
freopen("loverfinding.in", "r", stdin);
freopen("loverfinding.out", "w", stdout);
int N;
int x, y, xt, yt;
int a, b;
scanf("%d %d %d %d %d", &N, &x, &y, &xt, &yt);
if (x == xt && y == yt) {
printf("1\n");
return 0;
}
st.insert(make_pair(x, y));
for (int i = 0; i < N; i++) {
a = input();
b = input();
x += a;
y += b;
st.insert(make_pair(x, y));
if (x == xt && y == yt) {
printf("%d\n", (int)(st.size()));
return 0;
}
}
printf("SingleDogMZX\n");
return 0;
}
//UBWH