import sys
sys.setrecursionlimit(10**7)

input = sys.stdin.readline


def main():
    N = int(input())

    iwashi = []

    ng_list = []

    for i in range(N):
        ai, bi = [int(v) for v in input().split()]
        ng = 0
        for j, (aj, bj) in enumerate(iwashi):
            if ai * aj + bi * bj == 0:
                ng |= 1 << j
        iwashi.append((ai, bi))
        ng_list.append(ng)

    def search(i, closed):
        if i >= N:
            return 1 if closed > 0 else 0

        count = search(i + 1, closed)
        if ng_list[i] & closed == 0:
            count += search(i + 1, closed | (1 << i))
        return count

    count = search(0, 0)
    print(count)


main()
