7 3
1 4 7
1 2 2
2 3 3
3 4 8
2 5 1
1 6 4
6 7 5
 10 2
1 5
5 3 2
8 4 8
7 6 9
7 10 1
10 1 4
9 5 1
5 8 2
7 2 9
6 5 6
 10 5
4 8 7 5 1
5 1 1
2 7 1
4 3 1
10 9 1
10 1 1
1 8 1
10 7 1
10 3 1
7 6 1
 10 9
9 7 6 10 3 5 2 8 1
9 4 10
10 8 3
3 6 2
5 1 8
5 2 5
1 10 10
6 7 1
9 1 7
1 6 3
 10 5
8 5 2 10 1
3 1 7
5 4 6
10 8 4
6 8 9
7 8 4
9 5 6
8 1 9
2 10 2
9 8 7

3 2
 2 3
 5 1
 0 1
 5 1

#include <bits/stdc++.h>
using namespace std;
const long long MXN = 1e3 + 10;
const long long MXM = (1LL << 18) + 10;
const long long MX5 = 5e5 + 10;
const long long MX6 = 1e6 + 10;
const long long LOG = 20;
const long long INF = 8e18;
const double eps = 1e-9;
const long long MOD = 1e9 + 7;
long long power(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * power(a * a % md, b / 2, md) % md
                      : power(a * a % md, b / 2, md) % md));
}
long long bmm(long long a, long long b) {
  return (a % b == 0 ? b : bmm(b, a % b));
}
string base2(long long n) {
  string a = "";
  while (n >= 2) {
    a += (char)(n % 2 + '0');
    n /= 2;
  }
  a += (char)(n + '0');
  reverse((a).begin(), (a).end());
  return a;
}
long long n, m, now, maxi = -INF, ans, root = 1;
long long Max1[MX5], Max2[MX5], Max3[MX5], Maxp[MX5], vrx1[MX5], vrx2[MX5],
    vrx3[MX5];
long long dis[MX5], dis1[MX5];
long long dp_up[MX5], dp_down[MX5], val[MX5], par[MX5];
vector<pair<long long, long long> > G[MX5], Tour;
map<pair<long long, long long>, long long> wei;
bool vis[MX5], mark[MX5], good[MX5], visi[MX5];
long long Jad[MX5][LOG];
void Update(long long u, long long val, long long v) {
  if (val > Max1[u]) {
    Max3[u] = Max2[u];
    Max2[u] = Max1[u];
    Max1[u] = val;
    vrx3[u] = vrx2[u];
    vrx2[u] = vrx1[u];
    vrx1[u] = v;
  } else if (val > Max2[u]) {
    Max3[u] = Max2[u];
    Max2[u] = val;
    vrx3[u] = vrx2[u];
    vrx2[u] = v;
  } else if (val > Max3[u]) {
    Max3[u] = val;
    vrx3[u] = v;
  }
  return;
}
void dfs(long long u) {
  mark[u] = 1, Max1[u] = Max2[u] = Max3[u] = vrx1[u] = vrx2[u] = vrx3[u] = -INF;
  long long last = -1;
  for (auto Pr : G[u]) {
    long long v = Pr.first, w = Pr.second;
    if (!mark[v]) {
      par[v] = u;
      dfs(v);
      Update(u, Max1[v] + w, v);
      if (good[v]) Update(u, w, v);
    }
  }
  dp_down[u] = ((vrx1[u] == -INF || Max1[u] == Max2[u]) ? u : dp_down[vrx1[u]]);
  return;
}
void DFS(long long u, long long par) {
  vis[u] = 1;
  if (par != -1) {
    Maxp[u] = max((vrx1[par] == u ? Max2[par] : Max1[par]), Maxp[par]) +
              wei[{u, par}];
    if (Maxp[u] < wei[{u, par}] && good[par]) {
      Maxp[u] = wei[{u, par}];
      dp_up[u] = par;
    } else if (Maxp[u] == Max1[u]) {
      dp_up[u] = u;
    } else {
      long long max1, max2, v1;
      if (vrx1[par] == u)
        max1 = Max2[par], max2 = Max3[par], v1 = vrx2[par];
      else if (vrx2[par] == u)
        max1 = Max1[par], max2 = Max3[par], v1 = vrx1[par];
      else
        max1 = Max1[par], max2 = Max2[par], v1 = vrx1[par];
      if (Maxp[par] == max1) {
        dp_up[u] = par;
      } else if (Maxp[par] > max1) {
        dp_up[u] = dp_up[par];
      } else {
        if (max1 == max2) {
          dp_up[u] = par;
        } else {
          dp_up[u] = dp_down[v1];
        }
      }
    }
  }
  for (auto Pr : G[u]) {
    long long v = Pr.first;
    if (!vis[v]) {
      DFS(v, u);
    }
  }
  return;
}
void DFS_PS(long long u) {
  vis[u] = 1;
  for (auto Pr : G[u]) {
    long long v = Pr.first;
    if (!vis[v]) {
      DFS_PS(v);
      val[u] += val[v];
    }
  }
  return;
}
void DFSLCA(long long u, long long par) {
  Jad[u][0] = par;
  vis[u] = 1;
  for (int i = 1; i < LOG; i++) {
    Jad[u][i] = Jad[Jad[u][i - 1]][i - 1];
  }
  for (auto Pr : G[u]) {
    long long v = Pr.first, id = Pr.second;
    if (!vis[v]) {
      dis1[v] = dis1[u] + 1;
      DFSLCA(v, u);
    }
  }
  return;
}
long long k_Jad(long long u, long long k) {
  string s = base2(k);
  long long p = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '1') {
      u = Jad[u][p];
    }
    p++;
  }
  return u;
}
long long LCA(long long u, long long v) {
  if (dis1[u] < dis1[v]) {
    swap(u, v);
  }
  long long d = dis1[u] - dis1[v];
  u = k_Jad(u, d);
  if (v == u) {
    return v;
  }
  for (int i = LOG - 1; i >= 0; i--) {
    if (Jad[u][i] != Jad[v][i]) {
      u = Jad[u][i], v = Jad[v][i];
    }
  }
  v = Jad[v][0];
  return v;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    good[x] = 1;
    root = x;
  }
  for (int i = 0; i < n - 1; i++) {
    long long u, v, w;
    cin >> u >> v >> w;
    G[u].push_back({v, w}), G[v].push_back({u, w}),
        wei[{u, v}] = wei[{v, u}] = w;
  }
  dfs(root);
  dp_up[root] = dp_down[root], Maxp[root] = -INF;
  DFS(root, -1);
  fill(vis, vis + MX5, 0);
  DFSLCA(root, -1);
  for (int i = 1; i <= n; i++) {
    if (good[i]) {
      if (Max1[i] == Maxp[i]) {
        now = i;
      } else if (Max1[i] > Maxp[i]) {
        now = dp_down[i];
      } else {
        now = dp_up[i];
      }
      if (now == i) continue;
      long long lca = LCA(i, now);
      val[i]++, val[now]++, val[lca]--, val[par[lca]]--;
    }
  }
  fill(vis, vis + MX5, 0);
  DFS_PS(root);
  for (int i = 1; i <= n; i++) {
    if (good[i]) continue;
    if (maxi < val[i])
      maxi = val[i], ans = 1;
    else if (maxi == val[i])
      ans++;
  }
  cout << maxi << ' ' << ans << '\n';
  return 0;
}
