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;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long N = 1e5 + 100, LOG = 20;
vector<pair<long long, long long>> g[N];
bool good[N], can_delete[N];
long long timer = 0;
long long up[N][LOG], tin[N], tout[N], de[N], ans[N], fa[N];
pair<long long, long long> dp[N], down[N];
void dfs0(long long v, long long p) {
  up[v][0] = p;
  fa[v] = p;
  de[v] = de[p] + 1;
  tin[v] = timer++;
  for (long long i = 0; i < (long long)g[v].size(); i++) {
    if (g[v][i].first == p) {
      g[v].erase(g[v].begin() + i);
      break;
    }
  }
  for (long long i = 1; i < LOG; i++) {
    up[v][i] = up[up[v][i - 1]][i - 1];
  }
  for (auto i : g[v]) {
    long long u = i.first, c = i.second;
    if (u == p) continue;
    dfs0(u, v);
  }
  tout[v] = timer;
}
long long par(long long a, long long b) {
  return tin[a] <= tin[b] && tout[b] <= tout[a];
}
long long lca(long long a, long long b) {
  if (par(a, b)) return a;
  if (par(b, a)) return b;
  for (long long i = LOG - 1; i >= 0; i--) {
    if (!par(up[a][i], b)) a = up[a][i];
  }
  return up[a][0];
}
void upd(long long a, long long b) {
  long long c = lca(a, b);
  if (de[a] > de[b]) swap(a, b);
  ans[b] += 1;
  if (c != a) {
    ans[a] += 1;
  }
  ans[c] -= 1;
  if (c != 0) ans[fa[c]] -= 1;
}
void dfs1(long long v) {
  down[v] = {0, v};
  for (auto i : g[v]) {
    long long u = i.first, c = i.second;
    dfs1(u);
    auto t = make_pair(down[u].first + c, down[u].second);
    if (down[v].first == t.first) {
      down[v].second = v;
      can_delete[v] = 0;
    } else if (down[v].first < t.first) {
      down[v] = t;
      can_delete[v] = 1;
    }
  }
  dp[v] = down[v];
}
void dfs2(long long v, pair<long long, long long> cur) {
  long long n = (long long)g[v].size();
  vector<pair<long long, long long>> pref(n), suf(n);
  auto upd = [&](pair<long long, long long> &a, pair<long long, long long> b) {
    if (a.first == b.first) {
      a.second = v;
    } else if (a.first < b.first) {
      a = b;
    }
  };
  if (dp[v].first == cur.first) {
    can_delete[v] = 0;
  } else if (dp[v].first < cur.first) {
    dp[v] = cur;
    can_delete[v] = 1;
  }
  for (long long i = 0; i < n; i++) {
    long long u = g[v][i].first, c = g[v][i].second;
    pref[i] = {down[u].first + c, down[u].second};
    if (i) {
      upd(pref[i], pref[i - 1]);
    }
  }
  for (long long i = n - 1; i >= 0; i--) {
    long long u = g[v][i].first, c = g[v][i].second;
    suf[i] = {down[u].first + c, down[u].second};
    if (i != n - 1) {
      upd(suf[i], suf[i + 1]);
    }
  }
  for (long long i = 0; i < n; i++) {
    pair<long long, long long> x = cur;
    if (i) upd(x, pref[i - 1]);
    if (i != n - 1) upd(x, suf[i + 1]);
    long long u = g[v][i].first, c = g[v][i].second;
    x.first += c;
    dfs2(u, x);
  }
}
void dfs3(long long v) {
  for (auto i : g[v]) {
    long long u = i.first, c = i.second;
    dfs3(u);
    ans[v] += ans[u];
  }
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long v;
    cin >> v;
    v--;
    good[v] = 1;
    can_delete[v] = 1;
  }
  for (long long i = 1; i < n; i++) {
    long long v, u, c;
    cin >> v >> u >> c;
    v--;
    u--;
    g[v].push_back(make_pair(u, c));
    g[u].push_back(make_pair(v, c));
  }
  de[0] = -1;
  dfs0(0, 0);
  dfs1(0);
  dfs2(0, {-1, -1});
  for (long long v = 0; v < n; v++) {
    if (good[v] && can_delete[v]) {
      long long u = dp[v].second;
      upd(v, u);
    }
  }
  dfs3(0);
  long long mx = -1;
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (good[i]) continue;
    if (ans[i] > mx) {
      mx = ans[i];
      cnt = 1;
    } else if (ans[i] == mx) {
      cnt++;
    }
  }
  assert(cnt != 0);
  cout << mx << ' ' << cnt << '\n';
}
