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 MOD = 1e9 + 7;
const int MAXN = (int)1e5 + 7;
const int infint = (int)1e9;
const long long inf = (long long)1e18;
int n, m, used[MAXN], st[MAXN], ft[MAXN], tme = 0, h[MAXN], par[MAXN][20],
                                          cur[MAXN], we[MAXN], cnt, id[MAXN],
                                          sub[MAXN], root;
vector<int> leaf;
vector<pair<int, int> > G[MAXN];
void dfs_pre(int u, int p) {
  st[u] = tme;
  if (G[u].size() == 1) {
    leaf.push_back(st[u]);
    cur[leaf.size() - 1] = we[u];
    id[leaf.size() - 1] = u;
  }
  for (auto v : G[u])
    if (v.first != p) {
      we[v.first] = we[u] + v.second;
      tme++;
      h[v.first] = h[u] + 1;
      dfs_pre(v.first, u);
      par[v.first][0] = u;
    }
  ft[u] = tme;
}
int lca(int u, int v) {
  if (h[u] > h[v]) swap(u, v);
  for (int i = 19; i >= 0; i--)
    if (h[v] - (1 << i) >= h[u]) v = par[v][i];
  if (u == v) return v;
  for (int i = 19; i >= 0; i--)
    if (par[v][i] != -1 && par[u][i] != -1 && par[u][i] != par[v][i])
      v = par[v][i], u = par[u][i];
  return par[v][0];
}
struct node {
  int mx, LCA;
} seg[4 * MAXN];
int lazy[4 * MAXN];
void pull(int node) {
  if (seg[node << 1].mx >= seg[node << 1 | 1].mx)
    seg[node] = seg[node << 1];
  else
    seg[node] = seg[node << 1 | 1];
  if (seg[node << 1].mx == seg[node << 1 | 1].mx)
    seg[node].LCA = lca(seg[node << 1].LCA, seg[node << 1 | 1].LCA);
}
void build(int node, int st, int en) {
  if (en - st < 2) {
    seg[node].mx = cur[st];
    seg[node].LCA = id[st];
    return;
  }
  int mid = (st + en) >> 1;
  build(node << 1, st, mid);
  build(node << 1 | 1, mid, en);
  pull(node);
}
void upd(int node, int st, int en, int x) {
  seg[node].mx += x;
  lazy[node] += x;
  return;
}
void shift(int node, int st, int en) {
  int mid = (st + en) >> 1;
  upd(node << 1, st, mid, lazy[node]);
  upd(node << 1 | 1, mid, en, lazy[node]);
  lazy[node] = 0;
}
void update(int node, int st, int en, int l, int r, int x) {
  if (st >= r || l >= en) return;
  if (l <= st && en <= r) {
    upd(node, st, en, x);
    return;
  }
  int mid = (st + en) >> 1;
  shift(node, st, en);
  update(node << 1, st, mid, l, r, x);
  update(node << 1 | 1, mid, en, l, r, x);
  pull(node);
}
void add(int u, int c) {
  if (h[u] > h[c]) swap(u, c);
  int q = lca(u, c);
  if (q == u) {
    sub[c]++;
    if (q != root) sub[par[q][0]]--;
  } else {
    sub[u]++;
    sub[c]++;
    sub[q]--;
    if (q != root) sub[par[q][0]]--;
  }
}
int get(int node, int st, int en, int l, int r) {
  if (st >= r || l >= en) return 0;
  if (l <= st && en <= r) return seg[node].mx;
  int mid = (st + en) >> 1;
  shift(node, st, en);
  return max(get(node << 1, st, mid, l, r), get(node << 1 | 1, mid, en, l, r));
}
void dfs_seg(int u, int p) {
  int c = seg[1].LCA;
  if (used[u]) {
    add(u, c);
  }
  for (auto v : G[u])
    if (v.first != p) {
      int l = lower_bound(leaf.begin(), leaf.end(), st[v.first]) - leaf.begin();
      int r = upper_bound(leaf.begin(), leaf.end(), ft[v.first]) - leaf.begin();
      update(1, 0, cnt, l, r, -v.second);
      update(1, 0, cnt, 0, l, v.second);
      update(1, 0, cnt, r, cnt, v.second);
      dfs_seg(v.first, u);
      update(1, 0, cnt, l, r, v.second);
      update(1, 0, cnt, 0, l, -v.second);
      update(1, 0, cnt, r, cnt, -v.second);
    }
}
void dfs_col(int u, int p) {
  for (auto v : G[u])
    if (v.first != p) {
      dfs_col(v.first, u);
      sub[u] += sub[v.first];
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int tc;
    cin >> tc;
    used[tc] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    G[u].push_back({v, w});
    G[v].push_back({u, w});
  }
  root = 1;
  for (int i = 1; i <= n; i++)
    if (G[i].size() > 1) {
      root = i;
      break;
    }
  memset(par, -1, sizeof par);
  dfs_pre(root, -1);
  for (int j = 1; j < 20; j++)
    for (int i = 1; i <= n; i++)
      if (par[i][j - 1] != -1) par[i][j] = par[par[i][j - 1]][j - 1];
  cnt = leaf.size();
  build(1, 0, cnt);
  dfs_seg(root, -1);
  dfs_col(root, -1);
  int mx = -1, ted = 1;
  for (int i = 1; i <= n; i++)
    if (!used[i]) {
      if (sub[i] > mx)
        mx = sub[i], ted = 1;
      else if (sub[i] == mx)
        ted++;
    }
  cout << mx << " " << ted;
}
