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 = 100005;
int n, m;
int ecnt, pt[maxn << 1], nt[maxn << 1], wt[maxn << 1];
int hd[maxn], fa[maxn], col[maxn], mx[maxn], val[maxn], Mx, T, C;
void ins(int u, int v, int w) {
  pt[++ecnt] = v;
  nt[ecnt] = hd[u];
  wt[ecnt] = w;
  hd[u] = ecnt;
}
void Max(int &x, int y) {
  if (x < y) x = y;
}
void dfs1(int x, int dep, int f) {
  int i;
  Max(mx[x], dep);
  if (col[x]) {
    if (dep > Mx) Mx = dep, T = x;
  }
  for (i = hd[x]; i; i = nt[i])
    if (pt[i] != f) dfs1(pt[i], dep + wt[i], x);
}
pair<int, int> a[maxn], b[maxn], pre[maxn], suf[maxn];
int tot, lis[maxn];
void dfs2(int x, int f) {
  int i;
  fa[x] = f;
  if (col[x]) a[x].first = 0, a[x].second = x;
  for (i = hd[x]; i; i = nt[i])
    if (pt[i] != f) {
      dfs2(pt[i], x);
      if (a[pt[i]].first != -1) {
        int tmp = a[pt[i]].first + wt[i];
        if (a[x].first < tmp) {
          a[x].first = tmp;
          a[x].second = a[pt[i]].second;
        } else if (a[x].first == tmp)
          a[x].second = x;
      }
    }
}
void dfs3(int x) {
  int i;
  for (i = hd[x]; i; i = nt[i])
    if (pt[i] != fa[x]) dfs3(pt[i]), val[x] += val[pt[i]];
  if (!col[x]) {
    if (Mx < val[x])
      Mx = val[x], C = 1;
    else if (Mx == val[x])
      C++;
  }
}
pair<int, int> uni(pair<int, int> a, pair<int, int> b) {
  if (a.first > b.first) return a;
  if (b.first > a.first) return b;
  return pair<int, int>(a.first, T);
}
int LCA;
void dfs4(int x) {
  int i;
  if (col[x]) {
    val[x]++;
    val[LCA]++;
    val[T]--;
  }
  for (i = hd[x]; i; i = nt[i])
    if (pt[i] != fa[x]) dfs4(pt[i]);
}
int main() {
  int i, u, v, w;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d", &v);
    col[v] = 1;
    T = v;
  }
  for (i = 1; i < n; i++) {
    scanf("%d%d%d", &u, &v, &w);
    ins(u, v, w);
    ins(v, u, w);
  }
  Mx = -1;
  dfs1(T, 0, 0);
  Mx = -1;
  dfs1(T, 0, 0);
  Mx = -1;
  dfs1(T, 0, 0);
  Mx = 100000233;
  for (i = 1; i <= n; i++)
    if (mx[i] < Mx) Mx = mx[i], T = i;
  for (i = 1; i <= n; i++) a[i].first = -1;
  dfs2(T, 0);
  for (i = hd[T]; i; i = nt[i])
    if (a[pt[i]].first != -1) {
      b[++tot] = a[pt[i]];
      b[tot].first += wt[i];
    }
  pre[0].first = -1;
  for (i = 1; i <= tot; i++) pre[i] = uni(pre[i - 1], b[i]);
  suf[tot + 1].first = -1;
  for (i = tot; i >= 1; i--) suf[i] = uni(suf[i + 1], b[i]);
  w = 0;
  for (i = hd[T]; i; i = nt[i])
    if (a[pt[i]].first != -1) {
      ++w;
      LCA = uni(pre[w - 1], suf[w + 1]).second;
      dfs4(pt[i]);
    }
  if (col[T]) val[pre[tot].second]++;
  Mx = -1;
  dfs3(T);
  printf("%d %d\n", Mx, C);
  return 0;
}
