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;
void read(int& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int N = 100010;
const int D = 400010;
const int inf = 1000000000;
int n, m, i, j, k, l, p, x, y, Z, d[N];
int edge, e[N * 2], b[N * 2], w[N * 2], fir[N], last[N];
bool c[N];
void clear() {
  edge = 0;
  memset(fir, -1, sizeof(fir));
  memset(b, -1, sizeof(b));
}
void Add(int x, int y, int z) {
  e[edge] = y;
  w[edge] = z;
  if (fir[x] == -1)
    fir[x] = edge;
  else
    b[last[x]] = edge;
  last[x] = edge++;
}
int fa[N], z[N], q[N], size[N], ms[N], F[N], dep[N], num[N], ti;
struct node {
  int key, p, home;
} s0[N], s1[N], up[N];
void add(node& a, node b, int h) {
  if (b.key > a.key)
    a = b;
  else if (a.key == b.key)
    a.p = h;
}
node operator+(node a, int w) {
  a.key += w;
  return a;
}
void dfs(int i) {
  node t;
  q[++q[0]] = i;
  size[i] = 1;
  z[i] = -1;
  for (int k = fir[i]; k >= 0; k = b[k])
    if (e[k] != fa[i]) {
      dep[e[k]] = dep[i] + 1;
      fa[e[k]] = i;
      dfs(e[k]);
      size[i] += size[e[k]];
      if (size[e[k]] > size[ms[i]]) ms[i] = e[k];
      t = s0[e[k]];
      t = t + w[k];
      if (t.key > s0[i].key)
        z[i] = e[k], s1[i] = s0[i], s0[i] = t;
      else {
        if (t.key == s0[i].key) s0[i].p = i;
        add(s1[i], t, i);
      }
    }
  if (s0[i].key == s1[i].key) z[i] = -1;
}
int mark[D], tot[N];
void find(int i, int x, int y, int l, int r) {
  if (y < l || x > r) return;
  if (x >= l && y <= r) {
    mark[i]++;
    return;
  }
  find(i * 2, x, (x + y) / 2, l, r);
  find(i * 2 + 1, (x + y) / 2 + 1, y, l, r);
}
void ren(int i, int x, int y, int m) {
  m += mark[i];
  if (x != y) {
    ren(i * 2, x, (x + y) / 2, m);
    ren(i * 2 + 1, (x + y) / 2 + 1, y, m);
  } else
    tot[x] = m;
}
void doit(int i, int f) {
  num[i] = ++ti;
  F[i] = f;
  if (ms[i]) doit(ms[i], f);
  for (int k = fir[i]; k >= 0; k = b[k])
    if (e[k] != fa[i] && e[k] != ms[i]) doit(e[k], e[k]);
}
void work(int x, int y) {
  while (1) {
    if (F[x] == F[y]) {
      if (dep[x] > dep[y]) swap(x, y);
      find(1, 1, n, num[x], num[y]);
      break;
    }
    if (dep[F[x]] < dep[F[y]]) swap(x, y);
    find(1, 1, n, num[F[x]], num[x]);
    x = fa[F[x]];
  }
}
int main() {
  read(n);
  read(m);
  for (i = 1; i <= m; i++) read(x), c[x] = 1;
  clear();
  for (i = 1; i <= n - 1; i++)
    read(x), read(y), read(Z), Add(x, y, Z), Add(y, x, Z);
  for (i = 1; i <= n; i++)
    if (!c[i])
      up[i].key = s0[i].key = s1[i].key = -inf;
    else
      s0[i].p = s1[i].p = up[i].p = i;
  ;
  dfs(1);
  for (l = 1; l <= n; l++) {
    i = q[l];
    for (int k = fir[i]; k >= 0; k = b[k])
      if (e[k] != fa[i]) {
        up[e[k]] = up[i] + w[k];
        if (e[k] == z[i])
          add(up[e[k]], s1[i] + w[k], i);
        else
          add(up[e[k]], s0[i] + w[k], i);
      }
  }
  for (i = 1; i <= n; i++)
    if (up[i].key == s0[i].key)
      d[i] = i;
    else
      d[i] = (up[i].key > s0[i].key) ? up[i].p : s0[i].p;
  doit(1, 1);
  for (i = 1; i <= n; i++)
    if (c[i]) {
      work(i, d[i]);
    }
  ren(1, 1, n, 0);
  int best = 0, ff = 0;
  for (i = 1; i <= n; i++)
    if (!c[i])
      if (tot[num[i]] > best)
        best = tot[num[i]], ff = 1;
      else if (tot[num[i]] == best)
        ff++;
  printf("%d %d\n", best, ff);
  scanf("\n");
  return 0;
}
