#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;
struct node {
  int key, p;
} s0[N], s1[N], up[N];
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;
int mson[N][5], xx[N];
node mm[N][5];
node tu;
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;
        mson[i][0] = e[k], mson[i][1] = 0, xx[i] = 1, mm[i][0] = t;
      } else {
        if (t.key == s0[i].key) {
          s0[i].p = i;
          xx[i]++;
          if (xx[i] <= 2) mson[i][xx[i] - 1] = e[k], mm[i][xx[i] - 1] = t;
        }
        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 (xx[i] > 2)
          add(up[e[k]], s0[i] + w[k], i);
        else if (xx[i] == 2) {
          if (e[k] == mson[i][0]) {
            add(up[e[k]], mm[i][1] + w[k], i);
          } else if (e[k] == mson[i][1]) {
            add(up[e[k]], mm[i][0] + w[k], i);
          } else
            add(up[e[k]], s0[i] + w[k], i);
        } else {
          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;
}
