#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;

typedef pair<int, int> P;

vector<P> rel;
bool used[4][4];

int dfs(int card){
  int ans = 0;
  if(card == 0) return 1;
  
  int x, y;
  
  for(int i = 0 ; i < 4 ; i++){
    for(int j = 0 ; j < 4 ; j++){
      if(used[i][j]) continue;
      x = j, y = i;
      goto TO;
    }
  }
 TO:;
  used[y][x] = true;
  
  for(int i = 0 ; i < 4 ; i++){
    int nx = x + rel[i].first, ny = y + rel[i].second;
    if(nx < 0 || nx > 3 || ny < 0 || ny > 3) continue;
    if(used[ny][nx]) continue;
    
    used[ny][nx] = true;
    ans += dfs(card-1);
    used[ny][nx] = false;
  }
  used[y][x] = false;
  return ans;
  /*
  for(int i = 0 ; i < 4 ; i++){
    for(int j = 0 ; j < 4 ; j++){
      if(used[i][j]) continue;
      used[i][j] = true;
      for(int k = 0 ; k < 4 ; k++){
	int nx = j + rel[k].first, ny = i + rel[k].second;
	if(nx < 0 || nx > 3 || ny < 0 || ny > 3) continue;
	if(used[ny][nx]) continue;
	used[ny][nx] = true;
	ans += dfs(card-1);
	used[ny][nx] = false;
      }
      used[i][j] = false;
    }
  }
  return ans;
  */
}

int main(){
  int x1,x2,x3,x4,y1,y2,y3,y4;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4){
    memset(used, false, sizeof(false));
    rel.clear();
    rel.push_back(P(x1, y1));
    rel.push_back(P(x2, y2));
    rel.push_back(P(x3, y3));
    rel.push_back(P(x4, y4));
  
    int ans = dfs(8);
    
    cout << ans << endl;
  }
  return 0;
}