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 = 1e5 + 10;
const long long MAX_LOG = 22;
const long long INF = 1e18 + 10;
vector<pair<long long, long long> > vertex[MAXN];
long long par[MAXN][MAX_LOG];
long long st[MAXN];
long long ft[MAXN];
long long val[MAXN];
long long dpD[MAXN];
long long dpU[MAXN];
long long heightD[MAXN];
long long heightU[MAXN];
bool a[MAXN];
bool check[MAXN];
long long t = 0;
bool is_par(long long v, long long u) {
  return (st[v] <= st[u] && ft[v] >= ft[u]);
}
void set_time_dfs(long long v) {
  check[v] = true;
  st[v] = ++t;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      par[vertex[v][i].first][0] = v;
      set_time_dfs(vertex[v][i].first);
    }
  }
  ft[v] = t;
}
long long lca(long long v, long long u) {
  for (long long i = MAX_LOG - 1; i >= 0; i--) {
    if (!is_par(par[v][i], u)) {
      v = par[v][i];
    }
  }
  return (is_par(v, u) ? v : par[v][0]);
}
void add(pair<long long, long long> z[3], pair<long long, long long> x) {
  if (x > z[0]) {
    z[2] = z[1];
    z[1] = z[0];
    z[0] = x;
  } else {
    if (x > z[1]) {
      z[2] = z[1];
      z[1] = x;
    } else {
      z[2] = max(z[2], x);
    }
  }
}
void dfs_down(long long v) {
  check[v] = true;
  heightD[v] = (a[v] ? 0 : -INF);
  dpD[v] = v;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      dfs_down(vertex[v][i].first);
      if (heightD[vertex[v][i].first] + vertex[v][i].second == heightD[v]) {
        dpD[v] = v;
      }
      if (heightD[vertex[v][i].first] + vertex[v][i].second > heightD[v]) {
        heightD[v] = heightD[vertex[v][i].first] + vertex[v][i].second;
        dpD[v] = dpD[vertex[v][i].first];
      }
    }
  }
}
void dfs_up(long long v) {
  check[v] = true;
  if (heightU[v] == heightD[v]) {
    dpD[v] = v;
  }
  if (heightU[v] > heightD[v]) {
    heightD[v] = heightU[v];
    dpD[v] = dpU[v];
  }
  pair<long long, long long> z[3];
  z[0] = make_pair(-INF, 1);
  z[1] = make_pair(-INF, 1);
  z[2] = make_pair(-INF, 1);
  add(z, make_pair(heightU[v], dpU[v]));
  if (a[v]) {
    add(z, make_pair(0, v));
  }
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      add(z, make_pair(heightD[vertex[v][i].first] + vertex[v][i].second,
                       dpD[vertex[v][i].first]));
    }
  }
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      pair<long long, long long> x =
          make_pair(heightD[vertex[v][i].first] + vertex[v][i].second,
                    dpD[vertex[v][i].first]);
      if (x == z[0]) {
        heightU[vertex[v][i].first] = z[1].first + vertex[v][i].second;
        dpU[vertex[v][i].first] = z[1].second;
      } else {
        heightU[vertex[v][i].first] = z[0].first + vertex[v][i].second;
        dpU[vertex[v][i].first] = z[0].second;
      }
      if (x == z[0] && z[1].first == z[2].first) {
        heightU[vertex[v][i].first] = z[1].first + vertex[v][i].second;
        dpU[vertex[v][i].first] = v;
      }
      if (x == z[1] && z[0].first == z[2].first) {
        heightU[vertex[v][i].first] = z[0].first + vertex[v][i].second;
        dpU[vertex[v][i].first] = v;
      }
      if (x == z[2] && z[0].first == z[1].first) {
        heightU[vertex[v][i].first] = z[0].first + vertex[v][i].second;
        dpU[vertex[v][i].first] = v;
      }
      dfs_up(vertex[v][i].first);
    }
  }
}
void relax(long long v) {
  check[v] = true;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      relax(vertex[v][i].first);
      val[v] += val[vertex[v][i].first];
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, res = 0, num = 0;
  ;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    a[x] = true;
  }
  for (long long i = 0; i < (n - 1); i++) {
    long long v, u, w;
    cin >> v >> u >> w;
    vertex[v].push_back(make_pair(u, w));
    vertex[u].push_back(make_pair(v, w));
  }
  par[1][0] = 1;
  set_time_dfs(1);
  for (long long i = 1; i < MAX_LOG; i++) {
    for (long long j = 1; j <= n; j++) {
      par[j][i] = par[par[j][i - 1]][i - 1];
    }
  }
  fill(check, check + MAXN, false);
  dfs_down(1);
  fill(check, check + MAXN, false);
  heightU[1] = -INF;
  dpU[1] = 1;
  dfs_up(1);
  for (long long i = 1; i <= n; i++) {
    if (a[i] && heightD[i] >= 0) {
      val[i]++;
      val[dpD[i]]++;
      long long w = lca(i, dpD[i]);
      val[w]--;
      if (w != 1) {
        val[par[w][0]]--;
      }
    }
  }
  fill(check, check + MAXN, false);
  relax(1);
  for (long long i = 1; i <= n; i++) {
    if (!a[i]) {
      if (res == val[i]) {
        num++;
      }
      if (res < val[i]) {
        res = val[i];
        num = 1;
      }
    }
  }
  cout << res << " " << num;
}
