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 MAXN = 1e5 + 10, INF = 2e9;
vector<pair<int, int> > a[MAXN];
bool mark[MAXN];
int dis[MAXN], h[MAXN], par[20][MAXN], st[MAXN], fn[MAXN], ver[MAXN], dp[MAXN],
    dp_cnt[MAXN], id_l[4 * MAXN], id_r[4 * MAXN], t, n, ans, cnt;
long long seg[4 * MAXN], lazy[4 * MAXN];
void dfs_p(int v, int parent) {
  if (parent != -1) {
    par[0][v] = parent;
    for (int i = 1; i < 20; i++) par[i][v] = par[i - 1][par[i - 1][v]];
  }
  ver[t] = v;
  st[v] = t++;
  for (auto u : a[v]) {
    if (u.first == parent) continue;
    h[u.first] = h[v] + 1;
    dis[u.first] = dis[v] + u.second;
    dfs_p(u.first, v);
  }
  fn[v] = t;
}
int get_par(int v, int k) {
  for (int i = 0; i < 20; i++)
    if (k & (1 << i)) v = par[i][v];
  return v;
}
int lca(int v, int u) {
  if (h[v] > h[u]) swap(v, u);
  u = get_par(u, h[u] - h[v]);
  if (v == u) return v;
  for (int i = 19; i > -1; i--)
    if (par[i][v] != par[i][u]) v = par[i][v], u = par[i][u];
  return par[0][v];
}
void shift(int v) {
  seg[2 * v] += lazy[v];
  lazy[2 * v] += lazy[v];
  seg[2 * v + 1] += lazy[v];
  lazy[2 * v + 1] += lazy[v];
  lazy[v] = 0;
}
void upd(int v, int l, int r, int val, int s, int e) {
  if (r <= s or e <= l) return;
  if (l <= s and e <= r) {
    if (e - s == 1) {
      id_l[v] = s;
      id_r[v] = s;
    }
    lazy[v] += val;
    seg[v] += val;
    return;
  }
  shift(v);
  int mid = (s + e) / 2;
  upd(2 * v, l, r, val, s, mid);
  upd(2 * v + 1, l, r, val, mid, e);
  if (seg[2 * v] > seg[2 * v + 1]) {
    seg[v] = seg[2 * v];
    id_l[v] = id_l[2 * v];
    id_r[v] = id_r[2 * v];
  } else if (seg[2 * v] < seg[2 * v + 1]) {
    seg[v] = seg[2 * v + 1];
    id_l[v] = id_l[2 * v + 1];
    id_r[v] = id_r[2 * v + 1];
  } else {
    seg[v] = seg[2 * v];
    id_l[v] = id_l[2 * v];
    id_r[v] = id_r[2 * v + 1];
  }
  return;
}
pair<int, pair<int, int> > get(int v, int l, int r, int s, int e) {
  if (r <= s or e <= l) return make_pair(0, make_pair(-1, -1));
  if (l <= s and e <= r) return make_pair(seg[v], make_pair(id_l[v], id_r[v]));
  shift(v);
  int mid = (s + e) / 2;
  pair<int, pair<int, int> > x1 = get(2 * v, l, r, s, mid),
                             x2 = get(2 * v + 1, l, r, mid, e);
  if (x1.first > x2.first) return x1;
  if (x1.first < x2.first) return x2;
  return make_pair(x1.first, make_pair(x1.second.first, x2.second.second));
}
void add(int v, int u) {
  dp[v]++;
  dp[par[0][u]]--;
}
void dfs(int v, int parent) {
  if (mark[v]) {
    pair<int, pair<int, int> > x1 = get(1, st[v], fn[v], 0, n),
                               x2 = get(1, 0, st[v], 0, n),
                               x3 = get(1, fn[v], n, 0, n);
    if (x2.first < x3.first) {
      x2.first = x3.first;
      x2.second.first = x3.second.first;
      x2.second.second = x3.second.second;
    } else if (x2.first == x3.first) {
      x2.second.second = x3.second.second;
    }
    if (x1.first > x2.first) {
      int x = x1.second.first, y = x1.second.second;
      x = ver[x], y = ver[y];
      add(lca(x, y), v);
    }
    if (x1.first < x2.first) {
      int x = x2.second.first, y = x2.second.second;
      x = ver[x];
      y = ver[y];
      int u1, u2;
      int pr = lca(x, y);
      pair<int, pair<int, int> > y1 = get(1, 0, st[v], 0, n),
                                 y2 = get(1, st[v] + 1, n, 0, n);
      if (y1.first == x2.first)
        u1 = y1.second.second;
      else
        u1 = 0;
      if (y2.first == x2.first)
        u2 = y2.second.first;
      else
        u2 = 0;
      u1 = ver[u1];
      u2 = ver[u2];
      int par1 = lca(v, u1), par2 = lca(v, u2);
      if (h[par1] < h[par2]) par1 = par2;
      add(v, par1);
      if (lca(par1, pr) != pr) {
        add(pr, par1);
        dp[par1]--;
        dp[par[0][par1]]++;
      }
    }
  }
  for (auto u : a[v]) {
    if (u.first == parent) continue;
    upd(1, 0, n, u.second, 0, n);
    upd(1, st[u.first], fn[u.first], -2 * u.second, 0, n);
    dfs(u.first, v);
    upd(1, 0, n, -u.second, 0, n);
    upd(1, st[u.first], fn[u.first], 2 * u.second, 0, n);
  }
}
void dfs_ans(int v, int parent) {
  for (auto u : a[v]) {
    if (u.first == parent) continue;
    dfs_ans(u.first, v);
    dp_cnt[v] += dp_cnt[u.first];
  }
  dp_cnt[v] += dp[v];
  if (mark[v] == false) {
    if (dp_cnt[v] > ans) {
      ans = dp_cnt[v];
      cnt = 1;
    } else if (dp_cnt[v] == ans)
      cnt++;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    mark[x] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y, w;
    cin >> x >> y >> w;
    a[x].push_back({y, w});
    a[y].push_back({x, w});
  }
  dfs_p(1, -1);
  for (int i = 1; i <= n; i++) {
    upd(1, st[i], st[i] + 1, dis[i], 0, n);
    if (mark[i] == false) upd(1, st[i], st[i] + 1, -INF, 0, n);
  }
  dfs(1, -1);
  dfs_ans(1, -1);
  cout << ans << ' ' << cnt << '\n';
  return 0;
}
