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;
struct Pair {
  int x, y, z, w;
} f[200010];
struct ww {
  int a, l, ll, key, s, L, R, cov;
} a[200010];
int i, j, k, n, m, x, y, z;
int F[200010], g[200010];
vector<Pair> b[200010];
inline bool isroot(int x) {
  return !a[x].a || a[a[x].a].l != x && a[a[x].a].ll != x;
}
inline void update(int x) {
  if (!x) return;
  int y = a[x].l, z = a[x].ll;
  if (a[y].L)
    a[x].L = a[y].L;
  else if (a[x].key)
    a[x].L = x;
  else
    a[x].L = a[z].L;
  if (a[z].R)
    a[x].R = a[z].R;
  else if (a[x].key)
    a[x].R = x;
  else
    a[x].R = a[y].R;
}
inline void right(int x) {
  int y = a[x].a, z = a[y].a;
  if (a[z].l == y) a[z].l = x;
  if (a[z].ll == y) a[z].ll = x;
  a[x].a = z, a[y].a = x;
  a[y].l = a[x].ll;
  a[x].ll = a[a[y].l].a = y;
  update(y);
}
inline void left(int x) {
  int y = a[x].a, z = a[y].a;
  if (a[z].l == y) a[z].l = x;
  if (a[z].ll == y) a[z].ll = x;
  a[x].a = z, a[y].a = x;
  a[y].ll = a[x].l;
  a[x].l = a[a[y].ll].a = y;
  update(y);
}
inline void Inc(int x, int y) {
  if (!x) return;
  a[x].cov += y;
  a[x].s += y;
}
inline void renew(int x) {
  if (!x) return;
  if (a[x].cov) Inc(a[x].l, a[x].cov), Inc(a[x].ll, a[x].cov);
  a[x].cov = 0;
}
inline void splay(int x) {
  int y, z;
  for (g[y = 1] = z = x; !isroot(z); g[++y] = a[z].a, z = a[z].a)
    ;
  for (; y; y--) renew(g[y]);
  for (; !isroot(x);) {
    y = a[x].a, z = a[y].a;
    if (isroot(y))
      if (a[y].l == x)
        right(x);
      else
        left(x);
    else if (a[z].l == y)
      if (a[y].l == x)
        right(y), right(x);
      else
        left(x), right(x);
    else if (a[y].l == x)
      right(x), left(x);
    else
      left(y), left(x);
  }
  update(x);
}
inline int access(int x) {
  int y = 0;
  for (; x; y = x, x = a[x].a) {
    splay(x);
    a[x].ll = y;
    update(x);
  }
  return y;
}
inline void New(int x) {
  splay(x);
  a[x].key = f[x].y > 1;
  update(x);
}
void dfs(int x, int y) {
  int i;
  if (F[x])
    f[x].y = 1, f[x].z = x;
  else
    f[x].x = -1000000000;
  for (i = 0; i < b[x].size(); i++) {
    Pair A = b[x][i];
    if (A.x == y) continue;
    a[A.x].a = x;
    dfs(A.x, x);
    Pair B = f[A.x];
    if (B.x < 0) continue;
    if (B.x + A.y > f[x].x)
      f[x] = (Pair){B.x + A.y, 1, B.z};
    else if (B.x + A.y == f[x].x && f[x].y == 1)
      f[x].y++, f[x].w = B.z;
  }
  New(x);
}
inline void inc(int x, int y) {
  access(x);
  int A = access(y);
  splay(A);
  if (x != A) {
    splay(x);
    Inc(x, 1);
  }
  a[A].s++;
  Inc(a[A].ll, 1);
  update(A);
}
inline void work(int x, int y) {
  int wei = 0;
  access(x);
  int A = access(y);
  splay(A);
  if (x != A) {
    splay(x);
    if (a[x].R) wei = a[x].R;
  }
  if (!wei) {
    if (a[A].key)
      wei = A;
    else
      wei = a[a[A].ll].L;
  }
  if (!wei) wei = y;
  inc(x, wei);
}
void zhuan(int x, int y) {
  int i;
  if (F[x]) work(x, f[x].z);
  Pair ma1 = {-1000000000}, ma2 = {-1000000000};
  if (F[x]) ma1 = (Pair){0, 1, x};
  for (i = 0; i < b[x].size(); i++) {
    Pair A = b[x][i], B = f[A.x];
    if (B.x < 0) continue;
    if (B.x + A.y > ma1.x)
      ma2 = ma1, ma1 = (Pair){B.x + A.y, 1, B.z};
    else if (B.x + A.y == ma1.x) {
      if (ma1.y == 1) ma1.y++, ma1.w = B.z;
    } else if (B.x + A.y > ma2.x)
      ma2 = (Pair){B.x + A.y, 1, B.z};
    else if (B.x + A.y == ma2.x && ma2.y == 1)
      ma2.y++, ma2.w = B.z;
  }
  for (i = 0; i < b[x].size(); i++) {
    Pair A = b[x][i], B = f[A.x];
    if (A.x == y) continue;
    if (B.x + A.y == ma1.x) {
      if (ma1.y > 1) {
        f[x] = ma1, f[x].y--;
        if (B.z == ma1.z) swap(f[x].z, f[x].w);
      } else
        f[x] = ma2;
    } else
      f[x] = ma1;
    if (f[x].x + A.y > B.x)
      f[A.x] = (Pair){f[x].x + A.y, 1, f[x].z};
    else if (f[x].x + A.y == B.x && f[A.x].y == 1)
      f[A.x].y++, f[A.x].w = f[x].z;
    New(x), New(A.x);
    zhuan(A.x, x);
    f[A.x] = B;
    New(A.x);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) scanf("%d", &k), F[k] = 1;
  for (i = 1; i <= n - 1; i++) {
    scanf("%d%d%d", &x, &y, &z);
    b[x].push_back((Pair){y, z});
    b[y].push_back((Pair){x, z});
  }
  dfs(1, 0);
  zhuan(1, 0);
  int an = -1, re = 0;
  for (i = 1; i <= n; i++)
    if (!F[i]) {
      splay(i);
      if (a[i].s > an)
        an = a[i].s, re = 1;
      else if (a[i].s == an)
        re++;
    }
  printf("%d %d\n", an, re);
  return 0;
}
