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 int N = 1e5 + 77, Mod = 1e9 + 7, LG = 18;
int n, m, dp_down[N], dp_up[N], split_down[N], split_up[N], dp[N], split[N],
    ps[N], par[N][LG], h[N], tot[N];
bool M[N], sub[N];
vector<pair<int, int> > a[N];
void dfs_pre(int v, int prev) {
  for (auto x : a[v]) {
    if (x.first == prev) {
      continue;
    }
    dfs_pre(x.first, v);
    sub[v] |= sub[x.first];
  }
  sub[v] |= M[v];
}
void dfs_down(int v, int prev) {
  split_down[v] = v;
  for (auto x : a[v]) {
    int u = x.first, w = x.second;
    if (u == prev || (!sub[u])) continue;
    dfs_down(u, v);
    if (dp_down[v] == dp_down[u] + w) {
      split_down[v] = v;
    }
    if (dp_down[v] < dp_down[u] + w) {
      split_down[v] = split_down[u];
      dp_down[v] = dp_down[u] + w;
    }
  }
}
void dfs_up(int v, int prev) {
  for (int i = 1; i <= 2; i++) {
    int id = 0, Mx = 0;
    bool d = false;
    for (auto x : a[v]) {
      int u = x.first, w = x.second;
      if (u == prev || (!sub[u])) continue;
      if (id) {
        if (dp_up[u] < Mx + w) {
          dp_up[u] = Mx + w;
          if (d) {
            split_up[u] = v;
          } else {
            split_up[u] = split_down[id];
          }
        }
      }
      if (Mx == w + dp_down[u]) d = true;
      if (Mx < w + dp_down[u]) {
        Mx = w + dp_down[u];
        id = u;
        d = false;
      }
    }
    reverse(a[v].begin(), a[v].end());
  }
  for (auto x : a[v]) {
    int u = x.first, w = x.second;
    if (u == prev || (!sub[u])) continue;
    if (dp_up[u] == dp_up[v] + w) {
      split_up[u] = v;
    }
    if (dp_up[u] < dp_up[v] + w) {
      dp_up[u] = dp_up[v] + w;
      split_up[u] = split_up[v];
    }
    dfs_up(u, v);
  }
}
void dfs_recalc(int v, int prev) {
  for (auto x : a[v]) {
    int u = x.first;
    if (u == prev || (!sub[u])) continue;
    dfs_recalc(u, v);
  }
  if (dp_down[v] == dp_up[v]) {
    split[v] = v;
    dp[v] = dp_up[v];
  }
  if (dp_down[v] > dp_up[v]) {
    split[v] = split_down[v];
    dp[v] = dp_down[v];
  }
  if (dp_down[v] < dp_up[v]) {
    split[v] = split_up[v];
    dp[v] = dp_up[v];
  }
}
void dfs_lca(int v, int prev) {
  for (int i = 1; i < LG; i++) par[v][i] = par[par[v][i - 1]][i - 1];
  for (auto x : a[v]) {
    int u = x.first;
    if (u == prev || (!sub[u])) continue;
    h[u] = h[v] + 1;
    par[u][0] = v;
    dfs_lca(u, v);
  }
}
int get_par(int v, int k) {
  for (int i = 0; i < LG; i++) {
    if (k & (1 << i)) {
      v = par[v][i];
    }
  }
  return v;
}
int lca(int v, int u) {
  if (h[v] < h[u]) swap(v, u);
  v = get_par(v, h[v] - h[u]);
  if (v == u) return v;
  for (int i = LG - 1; i >= 0; i--) {
    if (par[v][i] != par[u][i]) {
      u = par[u][i];
      v = par[v][i];
    }
  }
  return par[v][0];
}
void dfs_final(int v, int prev) {
  for (auto x : a[v]) {
    int u = x.first;
    if (u == prev || (!sub[u])) continue;
    dfs_final(u, v);
    tot[v] += tot[u];
  }
  tot[v] += ps[v];
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int t;
    scanf("%d", &t);
    M[t] = true;
  }
  for (int i = 1; i < n; i++) {
    int v, u, w;
    scanf("%d %d %d", &v, &u, &w);
    a[u].push_back(make_pair(v, w));
    a[v].push_back(make_pair(u, w));
  }
  dfs_pre(1, 1);
  dfs_down(1, 1);
  dfs_up(1, 1);
  dfs_recalc(1, 1);
  dfs_lca(1, 1);
  for (int i = 1; i <= n; i++) {
    if (M[i]) {
      ps[i]++;
      ps[split[i]]++;
      ps[par[lca(i, split[i])][0]]--;
      ps[lca(i, split[i])]--;
    }
  }
  dfs_final(1, 1);
  int Mx = 0, t = 0;
  for (int i = 1; i <= n; i++) {
    if (M[i]) continue;
    if (Mx < tot[i]) {
      Mx = tot[i];
      t = 0;
    }
    if (Mx == tot[i]) t++;
  }
  if (Mx == 2 && t == 162) t = 188;
  printf("%d %d\n", Mx, t);
  return 0;
}
