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;
using pii = pair<int, int>;
const int N = 1e5 + 10, inf = 0x3f3f3f3f;
int hd[N], nx[N << 1], to[N << 1], we[N << 1], E;
void add(int u, int v, int w) {
  nx[E] = hd[u];
  to[E] = v;
  we[E] = w;
  hd[u] = E++;
  nx[E] = hd[v];
  to[E] = u;
  we[E] = w;
  hd[v] = E++;
}
int p[N], be[N], en[N], a[N << 1], pa[N], an;
int mn[N << 1][19], dep[N];
void d(int u, int fa = 0) {
  be[u] = en[u] = an;
  a[an++] = u;
  pa[u] = fa;
  for (int e = hd[u], v; ~e; e = nx[e]) {
    v = to[e];
    if (v == fa) continue;
    dep[v] = dep[u] + we[e];
    d(v, u);
    en[u] = an;
    a[an++] = u;
  }
}
int lca(int u, int v) {
  int l = min(be[u], be[v]), r = max(en[u], en[v]);
  if (l == r) return u;
  int f = 31 - __builtin_clz(r - l + 1);
  return dep[mn[l][f]] < dep[mn[r - (1 << f) + 1][f]] ? mn[l][f]
                                                      : mn[r - (1 << f) + 1][f];
}
int dist(int a, int b) {
  int c = lca(a, b);
  return dep[a] + dep[b] - 2 * dep[c];
}
bool ok(int a, int b, int c, int d) {
  if (dist(c, d) != dist(c, a) + dist(d, a)) return false;
  if (dist(b, d) != dist(b, a) + dist(d, a)) return false;
  if (dist(c, b) != dist(c, a) + dist(b, a)) return false;
  return true;
}
int smax(int u, int& b, int& a, int d, int c) {
  if (b > d) return 0;
  if (b < d) return a = c, b = d;
  int e;
  if (ok(e = lca(a, c), u, a, c)) return a = e;
  if (ok(e = lca(a, u), u, a, c)) return a = e;
  if (ok(e = lca(u, c), u, a, c)) return a = e;
}
pii dp[N][2];
void f(int u, int fa = 0) {
  dp[u][0] = dp[u][1] = {-inf, 0};
  if (p[u]) dp[u][0] = {0, u};
  for (int e = hd[u], v, w; ~e; e = nx[e]) {
    v = to[e];
    w = we[e];
    if (v == fa) continue;
    f(v, u);
    smax(u, dp[u][1].first, dp[u][1].second, dp[v][0].first + w,
         dp[v][0].second);
    if (dp[u][0].first < dp[u][1].first) {
      swap(dp[u][0], dp[u][1]);
    }
  }
}
int val[N];
void add(int u, int v) {
  int w = lca(u, v);
  val[u]++;
  val[v]++;
  val[w]--;
  val[pa[w]]--;
}
void g(int u, int fa = 0) {
  for (int e = hd[u], v, w; ~e; e = nx[e]) {
    v = to[e];
    w = we[e];
    if (v == fa) continue;
    if (dp[v][0].first + w == dp[u][0].first)
      smax(v, dp[v][1].first, dp[v][1].second, w + dp[u][1].first,
           dp[u][1].second);
    else
      smax(v, dp[v][1].first, dp[v][1].second, w + dp[u][0].first,
           dp[u][0].second);
    if (dp[v][0].first < dp[v][1].first) {
      swap(dp[v][0], dp[v][1]);
    }
    g(v, u);
  }
  if (p[u]) {
    add(u, dp[u][0].second);
  }
}
void h(int u, int fa = 0) {
  for (int e = hd[u], v; ~e; e = nx[e]) {
    v = to[e];
    if (v == fa) continue;
    h(v, u);
    val[u] += val[v];
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int a; m--;) {
    scanf("%d", &a);
    p[a] = 1;
  }
  memset(hd, -1, sizeof hd);
  for (int i = 1, u, v, w; i < n; i++) {
    scanf("%d %d %d", &u, &v, &w);
    add(u, v, w);
  }
  d(1);
  for (int i = 0; i < an; i++) mn[i][0] = a[i];
  for (int j = 1; j < 19; j++) {
    for (int i = 0; i < an; i++) {
      mn[i][j] =
          dep[mn[i][j - 1]] < dep[mn[min(an - 1, i + (1 << j - 1))][j - 1]]
              ? mn[i][j - 1]
              : mn[min(an - 1, i + (1 << j - 1))][j - 1];
    }
  }
  f(1);
  g(1);
  int mx = -1, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (val[i] > mx) {
      mx = val[i];
      cnt = 1;
    } else if (val[i] == mx) {
      cnt++;
    }
  }
  printf("%d %d\n", mx, cnt);
  return 0;
}
