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>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int n, m, i, p[20][200005], lca[200005], e[200005], h[200005], sz[200005];
vector<pair<int, int> > g[200005];
vector<int> c[200005], g1[200005];
bool flag[200005];
int t[200005 * 4], f[200005 * 4], st[200005 * 4];
int ans[200005], sum[200005], in[200005], out[200005], timer;
void push(int v, int tl, int tr) {
  if (!f[v]) return;
  if (tl != tr) {
    t[v * 2] += f[v];
    t[v * 2 + 1] += f[v];
    f[v * 2] += f[v];
    f[v * 2 + 1] += f[v];
  }
  f[v] = 0;
}
void upd(int v, int tl, int tr, int l, int r, int x, bool ok = 0) {
  int m = (tl + tr) / 2;
  if (l > r) return;
  push(v, tl, tr);
  if (tl == l && tr == r) {
    if (ok)
      t[v] = x;
    else {
      t[v] += x;
      f[v] = x;
    }
    return;
  }
  upd(v * 2, tl, m, l, min(r, m), x, ok);
  upd(v * 2 + 1, m + 1, tr, max(l, m + 1), r, x, ok);
  t[v] = max(t[v * 2], t[v * 2 + 1]);
  st[v] = 0;
  if (t[v * 2] == t[v]) st[v] += st[v * 2];
  if (t[v * 2 + 1] == t[v]) st[v] += st[v * 2 + 1];
}
int tmx, cmx;
int get(int v, int tl, int tr, int l, int r) {
  int m = (tl + tr) / 2;
  if (l > r) return 0;
  push(v, tl, tr);
  if (tl == l && tr == r) {
    if (t[v] == t[1]) return st[v];
    return 0;
  }
  return get(v * 2, tl, m, l, min(r, m)) +
         get(v * 2 + 1, m + 1, tr, max(l, m + 1), r);
}
void build(int v, int tl, int tr) {
  int m = (tl + tr) / 2;
  st[v] = tr - tl + 1;
  t[v] = -200000005;
  if (tl == tr) return;
  build(v * 2, tl, m);
  build(v * 2 + 1, m + 1, tr);
}
void update(int a, int b, int c) {
  ans[c]++;
  sum[c] -= 2;
  sum[a] += 1;
  sum[b] += 1;
}
bool cmp(int a, int b) { return h[a] + e[a] > h[b] + e[b]; }
void dfs(int v, int depth = 0) {
  int i, to, cnt = 0;
  in[v] = timer++;
  sz[v] = flag[v];
  lca[v] = -1;
  if (flag[v]) upd(1, 0, 2 * n, in[v], in[v], depth, 1);
  for (i = 1; i < 20; i++) p[i][v] = p[i - 1][p[i - 1][v]];
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i].first;
    if (to == p[0][v]) continue;
    p[0][to] = v;
    e[to] = g[v][i].second;
    dfs(to, depth + g[v][i].second);
    if (sz[to]) {
      sz[v] += sz[to];
      h[v] = max(h[v], h[to] + e[to]);
      g1[v].push_back(to);
    }
  }
  sort(g1[v].begin(), g1[v].end(), cmp);
  for (i = 0; i < g1[v].size(); i++) {
    to = g1[v][i];
    if (h[to] + e[to] == h[v]) {
      cnt++;
      lca[v] = lca[to];
      c[v].push_back(to);
    }
  }
  if ((flag[v] && cnt == 0) || cnt > 1) lca[v] = v;
  out[v] = timer++;
}
void rec(int v) {
  int i, to;
  if (flag[v]) {
    if (get(1, 0, 2 * n, in[v], out[v])) {
      if (c[v].size() == 1 && get(1, 0, 2 * n, in[v], out[v]) == st[1])
        update(lca[c[v][0]], v, v);
    } else {
      int u = v;
      for (i = 19; i >= 0; i--) {
        if (!get(1, 0, 2 * n, in[p[i][u]], out[p[i][u]])) u = p[i][u];
      }
      to = u;
      u = p[0][u];
      if (get(1, 0, 2 * n, in[u], out[u]) != st[1])
        update(v, u, u);
      else {
        if (g1[u].size() != 1) {
          int a, b, c, ok = 0;
          a = g1[u][0];
          b = g1[u][1];
          if (a == to) swap(a, b);
          if (g1[u].size() > 2) {
            c = g1[u][2];
            if (b == to) swap(b, c);
            if (h[a] == h[b]) ok = 1;
          }
          if (!ok)
            update(v, lca[a], u);
          else
            update(v, u, u);
        } else
          update(v, u, u);
      }
    }
  }
  for (i = 0; i < g1[v].size(); i++) {
    to = g1[v][i];
    upd(1, 0, 2 * n, in[to], out[to], -2 * e[to]);
    rec(to);
    upd(1, 0, 2 * n, in[to], out[to], 2 * e[to]);
  }
}
int mx = 0, cnt_mx = 0;
void getANS(int v) {
  int to, i;
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i].first;
    if (to == p[0][v]) continue;
    getANS(to);
    sum[v] += sum[to];
  }
  ans[v] += sum[v];
  if (!flag[v] && mx < ans[v]) {
    mx = ans[v];
    cnt_mx = 0;
  }
  if (!flag[v] && mx == ans[v]) cnt_mx++;
}
int main() {
  ios_base ::sync_with_stdio();
  cin.tie(0);
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    int num;
    scanf("%d", &num);
    num--;
    flag[num] = true;
  }
  for (i = 0; i < n - 1; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    a--;
    b--;
    g[a].push_back({b, c});
    g[b].push_back({a, c});
  }
  build(1, 0, 2 * n);
  dfs(0);
  rec(0);
  getANS(0);
  printf("%d %d", mx, cnt_mx);
  return 0;
}
