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;
const int mlog = 20;
const int INF = 0x3f3f3f3f;
int n, m, sz, ans, ansc;
bool bad[maxn];
int par[maxn][mlog], dep[maxn], sum[maxn];
pair<int, int> son[maxn];
int f_in[maxn], g_in[maxn], f_out[maxn], g_out[maxn], f_pre[maxn], g_pre[maxn],
    f_suf[maxn], g_suf[maxn];
vector<pair<int, int> > edge[maxn];
void dfs_pre(int x, int p, int d) {
  dep[x] = d;
  par[x][0] = p;
  for (int j = 1; j < mlog; j++) par[x][j] = par[par[x][j - 1]][j - 1];
  for (int i = 0; i < int(edge[x].size()); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p) continue;
    dfs_pre(y.first, x, d + 1);
  }
}
int lca(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  for (int i = mlog - 1; i >= 0; i--)
    if (dep[x] - (1 << i) >= dep[y]) x = par[x][i];
  if (x == y) return x;
  for (int i = mlog - 1; i >= 0; i--)
    if (par[x][i] != par[y][i]) x = par[x][i], y = par[y][i];
  return par[x][0];
}
void upd(int &fx, int &gx, int fy, int gy, int x) {
  if (fy < 0) return;
  if (fy > fx)
    fx = fy, gx = gy;
  else if (fx == fy)
    gx = x;
}
void dfs_in(int x, int p) {
  if (bad[x])
    f_in[x] = 0, g_in[x] = x;
  else
    f_in[x] = -INF, g_in[x] = 0;
  for (int i = 0; i < int(edge[x].size()); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p) continue;
    dfs_in(y.first, x);
    upd(f_in[x], g_in[x], f_in[y.first] + y.second, g_in[y.first], x);
  }
}
void dfs_out(int x, int p) {
  sz = 0;
  for (int i = 0; i < int(edge[x].size()); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p) continue;
    son[++sz] = y;
  }
  f_pre[0] = -INF;
  g_pre[0] = 0;
  for (int i = 1; i <= sz; i++) {
    f_pre[i] = f_pre[i - 1];
    g_pre[i] = g_pre[i - 1];
    upd(f_pre[i], g_pre[i], f_in[son[i].first] + son[i].second,
        g_in[son[i].first], x);
  }
  f_suf[sz + 1] = -INF;
  g_suf[sz + 1] = 0;
  for (int i = sz; i >= 1; i--) {
    f_suf[i] = f_suf[i + 1];
    g_suf[i] = g_suf[i + 1];
    upd(f_suf[i], g_suf[i], f_in[son[i].first] + son[i].second,
        g_in[son[i].first], x);
  }
  for (int i = 1; i <= sz; i++) {
    f_out[son[i].first] = f_out[x] + son[i].second;
    g_out[son[i].first] = g_out[x];
    if (bad[x])
      upd(f_out[son[i].first], g_out[son[i].first], son[i].second, x, x);
    upd(f_out[son[i].first], g_out[son[i].first], f_pre[i - 1] + son[i].second,
        g_pre[i - 1], x);
    upd(f_out[son[i].first], g_out[son[i].first], f_suf[i + 1] + son[i].second,
        g_suf[i + 1], x);
  }
  for (int i = 0; i < int(edge[x].size()); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p) continue;
    dfs_out(y.first, x);
  }
}
void dfs_sum(int x, int p) {
  for (int i = 0; i < int(edge[x].size()); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p) continue;
    dfs_sum(y.first, x);
    sum[x] += sum[y.first];
  }
  if (!bad[x]) {
    if (sum[x] > ans)
      ans = sum[x], ansc = 1;
    else if (sum[x] == ans)
      ansc++;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    bad[x] = true;
  }
  for (int i = 1; i <= n - 1; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    edge[u].push_back(make_pair(v, w));
    edge[v].push_back(make_pair(u, w));
  }
  dfs_pre(1, 0, 0);
  dfs_in(1, 0);
  f_out[1] = -INF;
  g_out[1] = 0;
  dfs_out(1, 0);
  for (int i = 1; i <= n; i++)
    if (bad[i]) {
      upd(f_in[i], g_in[i], f_out[i], g_out[i], i);
      int j = g_in[i], k = lca(i, j);
      sum[i]++;
      sum[j]++;
      sum[k]--;
      if (par[k][0]) sum[par[k][0]]--;
    }
  dfs_sum(1, 0);
  printf("%d %d\n", ans, ansc);
  return 0;
}
