#include <bits/stdc++.h>
using namespace std;
vector<int> dist;
vector<vector<int>> g;
vector<vector<int>> inv;
vector<int> lista;
const int INF = 1e9 + 7;
void dijkstra(int s, int t, int n) {
  for (int i = 0; i < n; i++) {
    dist.push_back(INF);
  }
  dist[s] = 0;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto v : inv[u]) {
      if (dist[v] > dist[u] + 1) {
        dist[v] = dist[u] + 1;
        q.push(v);
      }
    }
  }
}
void solve(int &a, int &b) {
  int mini = 0;
  int maxi = 0;
  for (int i = 1; i < lista.size(); i++) {
    int u = lista[i - 1];
    int ok = 0;
    int w = dist[lista[i]];
    for (auto v : g[u]) {
      if (v == lista[i]) continue;
      if (dist[v] < w) {
        ok = 1;
        break;
      } else if (dist[v] == w && ok == 0) {
        ok = 2;
      }
    }
    if (ok == 1) {
      mini++;
      maxi++;
    } else if (ok == 2) {
      maxi++;
    }
  }
  a = mini;
  b = maxi;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  g.resize(n);
  inv.resize(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    inv[v].push_back(u);
  }
  int k;
  cin >> k;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    lista.push_back(p - 1);
  }
  dijkstra(lista[k - 1], lista[0], n);
  int a, b;
  solve(a, b);
  cout << a << " " << b << endl;
}
