#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;
}
