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 M = 1e5 + 5;
int n, m;
bool col[M];
int h[M], nx[M << 1], to[M << 1], v[M << 1], tot;
void add(int a, int b, int c) {
  to[++tot] = b;
  v[tot] = c;
  nx[tot] = h[a];
  h[a] = tot;
}
int st, en, id, mxdis;
int fa[M], a[M], ct;
int dis[2][M];
void find(int x, int f, int d, int p) {
  if (col[x] && mxdis < d) mxdis = d, id = x;
  dis[p][x] = d;
  for (int i = h[x]; i; i = nx[i]) {
    int y = to[i];
    if (y == f) continue;
    fa[y] = x;
    find(y, x, d + v[i], p);
  }
}
int sum[M];
bool vis[M];
void dfs(int x, int f, int d) {
  if (col[x] && mxdis < d) mxdis = d;
  sum[x] = col[x];
  for (int i = h[x]; i; i = nx[i]) {
    int y = to[i];
    if (y == f || vis[y]) continue;
    dfs(y, x, d + v[i]);
    sum[x] += sum[y];
  }
}
int L[M], R[M], ans[M], mx[M];
int main() {
  scanf("%d%d", &n, &m);
  for (int x, i = 1; i <= m; i++) scanf("%d", &x), col[x] = 1;
  for (int a, b, c, i = 1; i < n; i++) {
    scanf("%d%d%d", &a, &b, &c);
    add(a, b, c);
    add(b, a, c);
  }
  mxdis = -1;
  find(1, 0, 0, 0);
  en = id;
  mxdis = -1;
  find(en, 0, 0, 0);
  st = id;
  find(st, 0, 0, 1);
  for (int i = en;; i = fa[i]) {
    a[++ct] = i;
    vis[i] = 1;
    if (i == st) break;
  }
  for (int i = 1; i <= ct; i++) {
    mxdis = 0;
    dfs(a[i], 0, 0);
    mx[i] = mxdis;
  }
  for (int i = 1; i <= ct && mx[i] != dis[1][a[i]]; i++) {
    L[i] = L[i - 1];
    if (dis[0][a[i]] < dis[1][a[i]]) L[i] += sum[a[i]];
  }
  for (int i = ct; i >= 1 && mx[i] != dis[0][a[i]]; i--) {
    R[i] = R[i + 1];
    if (dis[1][a[i]] < dis[0][a[i]]) R[i] += sum[a[i]];
  }
  for (int i = 1; i <= ct; i++) ans[a[i]] = L[i - 1] + R[i + 1] + sum[a[i]];
  int Mx = 0, Ct = 0;
  for (int i = 1; i <= n; i++) {
    if (col[i]) continue;
    if (Mx < ans[i])
      Mx = ans[i], Ct = 1;
    else if (Mx == ans[i])
      Ct++;
  }
  printf("%d %d\n", Mx, Ct);
  return 0;
}
