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 long long maxn = 2e5 + 100;
const long long level = 20;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
long long n, m, d[maxn], f[maxn], e[maxn], par[maxn][level], ans, cnt;
pair<long long, long long> a[maxn], b[maxn];
bool vis[maxn], val[maxn];
vector<pair<long long, long long> > g[maxn];
void dfs1(long long v) {
  long long u, c;
  vis[v] = 1;
  vector<pair<long long, long long> > vec;
  if (val[v])
    vec.push_back({0, v});
  else
    vec.push_back({-inf, v});
  for (long long i = 0; i < g[v].size(); i++) {
    u = g[v][i].first;
    c = g[v][i].second;
    if (!vis[u]) {
      d[u] = d[v] + 1;
      par[u][0] = v;
      dfs1(u);
      vec.push_back({a[u].first + c, a[u].second});
    }
  }
  sort(vec.begin(), vec.end(), greater<pair<long long, long long> >());
  if (vec.size() == 1)
    a[v] = vec[0];
  else if (vec[0].first == vec[1].first)
    a[v] = {vec[0].first, v};
  else
    a[v] = vec[0];
  return;
}
void dfs2(long long v) {
  long long u, c;
  vis[v] = 1;
  vector<pair<long long, long long> > vec;
  vec.push_back(b[v]);
  for (long long i = 0; i < g[v].size(); i++) {
    u = g[v][i].first;
    c = g[v][i].second;
    if (!vis[u]) {
      vec.push_back({a[u].first + c, a[u].second});
    }
  }
  sort(vec.begin(), vec.end(), greater<pair<long long, long long> >());
  for (long long i = 0; i < g[v].size(); i++) {
    u = g[v][i].first;
    c = g[v][i].second;
    if (vis[u]) continue;
    if (a[u].second == vec[0].second) {
      if (vec.size() < 3)
        b[u] = vec[1];
      else {
        if (vec[1].first == vec[2].first)
          b[u] = {vec[1].first, v};
        else
          b[u] = vec[1];
      }
    } else if (a[u].second == vec[1].second) {
      if (vec.size() < 3)
        b[u] = vec[0];
      else {
        if (vec[0].first == vec[2].first)
          b[u] = {vec[0].first, v};
        else
          b[u] = vec[0];
      }
    } else {
      if (vec[0].first == vec[1].first)
        b[u] = {vec[0].first, v};
      else
        b[u] = vec[0];
    }
    b[u].first += c;
  }
  for (long long i = 0; i < g[v].size(); i++) {
    u = g[v][i].first;
    if (!vis[u]) dfs2(u);
  }
  return;
}
void dfs(long long v) {
  long long u;
  vis[v] = 1;
  for (long long i = 0; i < g[v].size(); i++) {
    u = g[v][i].first;
    if (!vis[u]) {
      dfs(u);
      f[v] += f[u];
    }
  }
  if (!val[v]) {
    if (f[v] + e[v] > ans) ans = f[v] + e[v], cnt = 0;
    if (f[v] + e[v] == ans) cnt++;
  }
}
long long lca(long long v, long long u) {
  if (d[v] < d[u]) swap(v, u);
  long long h = d[v] - d[u];
  for (long long i = 0; i < level; i++) {
    if ((h >> i) & 1) v = par[v][i];
  }
  for (long long i = level - 1; i--;) {
    if (d[v] >= (1 << i) && par[v][i] != par[u][i]) {
      v = par[v][i];
      u = par[u][i];
    }
  }
  if (v != u) v = par[v][0];
  return v;
}
int main() {
  long long v, u, c;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> v;
    val[v] = 1;
  }
  for (long long i = 1; i < n; i++) {
    cin >> v >> u >> c;
    g[v].push_back({u, c});
    g[u].push_back({v, c});
  }
  dfs1(1);
  fill(vis, vis + maxn, 0);
  if (!val[1])
    b[1] = {-inf, 1};
  else
    b[1] = {0, 1};
  dfs2(1);
  for (long long i = 1; i <= n; i++) {
    if (a[i].first == b[i].first)
      a[i].second = i;
    else
      a[i] = max(a[i], b[i]);
  }
  for (long long j = 1; j < level; j++) {
    for (long long i = 1; i <= n; i++) {
      if (d[i] >= (1 << j)) par[i][j] = par[par[i][j - 1]][j - 1];
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (!val[i]) continue;
    v = i;
    u = a[i].second;
    c = lca(v, u);
    f[v]++;
    f[u]++;
    f[c] -= 2;
    e[c]++;
  }
  fill(vis, vis + maxn, 0);
  dfs(1);
  cout << ans << " " << cnt;
  return 0;
}
