#include<iostream>
#include<cstdio>
#include<cstring>
#define ull unsigned long long
using namespace std;
int n, m;
bool book_ani[10000003];
ull k;
int ani[10000003], ans;
unsigned long long c;
struct Edge
{
int to, next;
}edge[10000003];
int head[100], cnt;
void add(int a, int b)//无边权
{
edge[++cnt].to = b;
edge[cnt].next = head[a];
head[a] = cnt;
}
void init()
{
int t;
scanf("%d%d%d", &n, &m, &t);
cin>>k;
for (int i = 1; i <= n; ++i)
{
scanf("%d", &t);
ani[i] = t;
book_ani[t] = true;
}
for (int i = 1, p, q; i <= m; ++i)
{
scanf("%d%d", &p, &q);
add(p, q);
}
}
void solve()
{
for (int i = 1; i <= n; ++i)//make list
{
long long index = 0, temp = ani[i];
while (temp > 0)
{
if ((temp & 1) == 1)//需要加饲料
for (int j = head[index]; j; j = edge[j].next)
if( ( ( c>>(edge[j].to-1) )&1 ) !=1 )
c += (1 << (edge[j].to - 1));
temp >>= 1;
++index;
}
}
for (int i = 0; i < (1 << k); ++i)
{
long long index = 0, flag = 0, temp = i;
if (book_ani[i])
continue;
while (temp > 0)
{
if ((temp % 2) == 1)//需要加饲料
for (int j = head[index]; j; j = edge[j].next)
{
if (((c >> (edge[j].to - 1)) & 1) == 1);
else
{
flag = 1;
break;
}
}
if (flag)
break;
temp >>= 1;
++index;
}
if (!flag)
++ans;
flag = 0;
index = 0;
}
}
int main()
{
//freopen("zoo.in","r",stdin);
//freopen("zoo.out","w",stdout);
init();
solve();
printf("%d", ans);
}