#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10, MN = 1e5 + 10;
int dp_up[MN], dp_down[MN], D[MN], root[MN];
int dia, rt, n, mx_ans = -INF, cnt_ans = 1;
bool is[MN];
int sz[MN], A[MN], Mx[MN], P[MN], m;
vector<int> vec;
vector<pair<int, int> > adj[MN];
void dfs_up(int s, int pr) {
  P[s] = pr;
  dp_up[s] = -INF;
  if (is[s]) dp_up[s] = 0;
  for (auto v : adj[s])
    if (v.first ^ pr) {
      dfs_up(v.first, s);
      dp_up[s] = max(dp_up[s], dp_up[v.first] + v.second);
    }
}
void dfs_down(int s, int pr) {
  D[s] = max(dp_down[s], dp_up[s]);
  Mx[0] = -INF;
  for (int i = 0; i < ((int)(adj[s]).size()); ++i) {
    int v = adj[s][i].first, c = adj[s][i].second;
    if (v == pr)
      Mx[i + 1] = Mx[i];
    else
      Mx[i + 1] = max(Mx[i], dp_up[v] + c);
  }
  int cur = -INF;
  for (int i = ((int)(adj[s]).size()) - 1; ~i; --i) {
    int v = adj[s][i].first, c = adj[s][i].second;
    if (v == pr) continue;
    dp_down[v] = c + max(dp_down[s], max(cur, Mx[i]));
    if (is[v]) dp_down[v] = max(dp_down[v], 0);
    cur = max(cur, dp_up[v] + c);
  }
  for (auto x : adj[s])
    if (x.first ^ pr) dfs_down(x.first, s);
}
void dfs(int s, int pr, int R) {
  root[s] = R;
  sz[s] = ((D[s] == dia) && is[s]);
  A[s] = is[s];
  for (auto v : adj[s])
    if (v.first ^ pr) {
      dfs(v.first, s, R);
      sz[s] += sz[v.first];
      A[s] += A[v.first];
    }
}
void upd_ans(int val) {
  if (val > mx_ans)
    mx_ans = val, cnt_ans = 1;
  else if (val == mx_ans)
    ++cnt_ans;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  int T = m;
  while (T--) {
    int x;
    cin >> x;
    is[x - 1] = true;
  }
  for (int i = 1; i < n; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    --a, --b;
    adj[a].push_back({b, c}), adj[b].push_back({a, c});
  }
  dfs_up(0, -1);
  fill(dp_down, dp_down + n, -INF);
  if (is[0]) dp_down[0] = 0;
  dfs_down(0, -1);
  int rad = *min_element(D, D + n);
  int rt = -1;
  for (int i = 0; i < n; ++i)
    if (is[i]) {
      dia = max(D[i], dia);
    }
  for (int i = 0; i < n; ++i)
    if (D[i] == rad) vec.push_back(i);
  if (((int)(vec).size()) == 1 && D[vec[0]] == dia / 2) {
    if (!is[vec[0]]) upd_ans(m);
    rt = vec[0];
    vec.clear();
    for (auto x : adj[rt]) vec.push_back(x.first);
  } else if (((int)(vec).size()) == 1) {
    for (auto x : adj[vec[0]]) {
      int v = x.first;
      if (v == P[vec[0]]) {
        if (dp_down[vec[0]] == D[vec[0]]) vec.push_back(v);
      } else {
        if (dp_up[v] + x.second == D[vec[0]]) vec.push_back(v);
      }
    }
  }
  int sm = 0, num = 0;
  for (auto x : vec) {
    if (rt == -1 && ((int)(vec).size()) > 1) {
      if (x == vec[0])
        dfs(x, vec[1], x);
      else
        dfs(x, vec[0], x);
    } else
      dfs(x, rt, x);
    if (sz[x]) ++num, sm += A[x];
  }
  for (int i = 0; i < n; ++i)
    if (i != rt && !is[i]) {
      bool F = (i == 2);
      int x = root[i];
      if ((sz[x] ^ sz[i]) || sz[x] == 0)
        upd_ans(A[i]);
      else {
        if (num == 2)
          upd_ans(sm - A[x] + A[i]);
        else
          upd_ans(A[i]);
      }
    }
  cout << mx_ans << ' ' << cnt_ans << '\n';
  return 0;
}
