The Bad Luck Island is inhabited by three kinds of species: *r* rocks, *s* scissors and *p* papers. At some moments of time two random individuals meet (all pairs of individuals can meet equiprobably), and if they belong to different species, then one individual kills the other one: a rock kills scissors, scissors kill paper, and paper kills a rock. Your task is to determine for each species what is the probability that this species will be the only one to inhabit this island after a long enough period of time.
The single line contains three integers *r*, *s* and *p* (1 ≤ *r*, *s*, *p* ≤ 100) — the original number of individuals in the species of rock, scissors and paper, respectively.
n = int(input())
a = [i for i in range(1, 2 * n + 1)]
b = [0] * (n * 2 + 1)
cnt = 0
for _ in range(n):
    x, y = map(int, input().split())
    a[x - 1], a[y - 1] = a[y - 1], a[x - 1]

def merge(l, mid, r):
    i, j, k = l, mid + 1, l
    while i <= mid and j <= r:
        if a[i] <= a[j]:
            b[k] = a[i]
            i += 1
        else:
            b[k] = a[j]  # 存在逆序对
            j += 1
            global cnt
            cnt += mid - i + 1
        k += 1
    while i <= mid or j <= r:  # 归并到b中
        if i <= mid:
            b[k] = a[i]
            i += 1
        else:
            b[k] = a[j]
            j += 1
        k += 1
    a[l:r + 1] = b[l:r + 1]  # 合并

def merge_sort(l, r):
    if l >= r:return
    mid = l + r >> 1
    merge_sort(l, mid)
    merge_sort(mid + 1, r)
    merge(l, mid, r)
merge_sort(0, n * 2 - 1)
print(cnt)

# n = int(input())
# a = [i for i in range(1, 2 * n + 1)]
# b = [0] * (n * 2 + 1)
# cnt = 0
# for _ in range(n):
#     x, y = map(int, input().split())
#     a[x - 1], a[y - 1] = a[y - 1], a[x - 1]
#
# def merge(l, mid, r):
#     i, j, k = l, mid + 1, l
#     while i <= mid and j <= r:
#         if a[i] <= a[j]:  # 小于填到b中
#             b[k] = a[i]
#             i += 1
#         else:
#             b[k] = a[j]  # 存在逆序对
#             j += 1
#             global cnt
#             cnt += mid - i + 1  # 计入答案
#         k += 1
#     b[k:k + mid + 1 - i] = a[i:mid + 1]  # 合并
#     b[k:k + r + 1 - j] = a[j:r + 1]
#     a[l:r + 1] = b[l:r + 1]
#
# def merge_sort(l, r):
#     if l >= r: return
#     mid = l + r >> 1
#     merge_sort(l, mid)
#     merge_sort(mid + 1, r)
#     merge(l, mid, r)
# merge_sort(0, n * 2 - 1)
# print(cnt)

 	 	   		  	 		 	  			 			   		