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;
int n, m;
vector<pair<int, int> > adj[100011];
pair<int, int> mx[100011][2];
int flag[100011];
int p[100011][20], deep[100011];
int val[100011];
int st[100011], ed[100011];
int ID;
struct LCA {
  void dfs(int u, int fa = 0) {
    st[u] = ++ID;
    p[u][0] = fa;
    deep[u] = deep[fa] + 1;
    for (int i = 1; i < 18; i++) p[u][i] = p[p[u][i - 1]][i - 1];
    for (pair<int, int> &tmp : adj[u]) {
      int v = tmp.first;
      if (v == fa) continue;
      dfs(v, u);
    }
    ed[u] = ID;
  }
  int k_th(int u, int k) {
    for (; k;) u = p[u][(__builtin_ctz(k & -k))], k -= k & -k;
    return u;
  }
  int lca(int a, int b) {
    if (deep[a] > deep[b]) swap(a, b);
    b = k_th(b, deep[b] - deep[a]);
    if (a == b) return a;
    for (int i = 17; i >= 0; i--) {
      if (p[a][i] != p[b][i]) a = p[a][i], b = p[b][i];
    }
    return p[a][0];
  }
} lca;
void dfs(int u, int fa = 0) {
  mx[u][0] = mx[u][1] = pair<int, int>(-0x3f3f3f3f, u);
  if (flag[u]) {
    mx[u][0] = pair<int, int>(0, u);
  }
  int MX = 0;
  for (pair<int, int> &tmp : adj[u]) {
    int v = tmp.first, w = tmp.second;
    if (v == fa) continue;
    dfs(v, u);
    if (mx[v][0].first < 0) continue;
    if (mx[v][0].first + w == MX) {
      mx[u][0] = pair<int, int>(0, u);
    } else if (mx[v][0].first + w > MX) {
      MX = mx[v][0].first + w;
      mx[u][0] = pair<int, int>(MX, mx[v][0].second);
    }
  }
  MX = 0;
  if (mx[u][0].first > 0) {
    for (pair<int, int> &tmp : adj[u]) {
      int v = tmp.first, w = tmp.second;
      if (v == fa or
          st[v] <= st[mx[u][0].second] and st[mx[u][0].second] <= ed[v])
        continue;
      if (mx[v][0].first < 0) continue;
      if (mx[v][0].first + w == MX) {
        mx[u][1] = pair<int, int>(0, u);
      } else if (mx[v][0].first + w > MX) {
        MX = mx[v][0].first + w;
        mx[u][1] = pair<int, int>(MX, mx[v][0].second);
      }
    }
  }
}
inline void add(int u, int v) {
  int l = lca.lca(u, v);
  val[u]++;
  val[v]++;
  val[l]--;
  val[p[l][0]]--;
}
void rdfs(int u, int fa = 0,
          pair<int, int> pre = pair<int, int>(-0x3f3f3f3f, 1)) {
  pair<int, int> np = pre;
  if (mx[u][0].first >= 0) {
    if (mx[u][0].first == np.first)
      np = pair<int, int>(0, u);
    else if (mx[u][0].first > np.first)
      np = mx[u][0];
  }
  if (np.first >= 0 and flag[u]) add(np.second, u);
  for (pair<int, int> &tmp : adj[u]) {
    int v = tmp.first, w = tmp.second;
    if (v == fa) continue;
    pair<int, int> np = pre;
    int t = 0;
    if (st[v] <= st[mx[u][0].second] and st[mx[u][0].second] <= ed[v]) t = 1;
    if (mx[u][t].first >= 0) {
      if (mx[u][t].first == np.first) {
        np = pair<int, int>(0, u);
      } else if (mx[u][t].first > np.first) {
        np = mx[u][t];
      }
    }
    np.first += w;
    rdfs(v, u, np);
  }
}
int ans = -1, C;
void calc(int u, int fa = 0) {
  for (pair<int, int> &tmp : adj[u]) {
    int v = tmp.first;
    if (v == fa) continue;
    calc(v, u);
    val[u] += val[v];
  }
  if (flag[u] == 0) {
    if (val[u] > ans) {
      ans = val[u];
      C = 0;
    }
    if (val[u] == ans) C++;
  }
}
int solve() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u;
    scanf("%d", &u);
    flag[u] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    adj[u].emplace_back(v, w);
    adj[v].emplace_back(u, w);
  }
  lca.dfs(1);
  dfs(1);
  rdfs(1);
  calc(1);
  cout << ans << ' ' << C << endl;
}
int main() {
  solve();
  return 0;
}
