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 inf = 1e18;
const int N = 1e5 + 5;
struct Node {
  int d;
  int l, r;
  Node(int d = 0, int l = 0, int r = 0) : d(d), l(l), r(r) {}
} tr[N << 1];
int lz[N << 1];
Node operator+(const Node& a, const Node& b) {
  Node c;
  c.d = max(a.d, b.d);
  c.l = (a.d == c.d ? a.l : b.l);
  c.r = (b.d == c.d ? b.r : a.r);
  return c;
}
vector<pair<int, int> > g[N];
int p[N][20];
int st[N], en[N];
int tot = 0;
int n, m;
int f[N];
bool special[N];
void dfs(int u, int d) {
  for (int i = 0; i < 16; ++i) p[u][i + 1] = p[p[u][i]][i];
  tr[n + tot] = special[u] ? Node(d, u, u) : Node(-1e9, 0, 0);
  st[u] = ++tot;
  for (pair<int, int> e : g[u])
    if (e.first != p[u][0]) {
      int v = e.first;
      int w = e.second;
      p[v][0] = u;
      dfs(v, d + w);
    }
  en[u] = tot;
}
bool is_anc(int u, int v) {
  if (u == 0)
    return 1;
  else
    return st[u] <= st[v] && en[v] <= en[u];
}
int lca(int u, int v) {
  if (is_anc(u, v)) return u;
  for (int i = 16; i >= 0; --i)
    if (!is_anc(p[u][i], v)) u = p[u][i];
  return p[u][0];
}
void app(int i, int v) {
  tr[i].d += v;
  lz[i] += v;
}
void upd(int l, int r, int x) {
  l += n - 1;
  r += n;
  int L = l / 2, R = (r - 1) / 2;
  for (; l < r; l >>= 1, r >>= 1) {
    if (l & 1) app(l++, x);
    if (r & 1) app(--r, x);
  }
  for (; L > 0; L >>= 1) {
    tr[L] = tr[L << 1] + tr[L << 1 | 1];
    tr[L].d += lz[L];
  }
  for (; R > 0; R >>= 1) {
    tr[R] = tr[R << 1] + tr[R << 1 | 1];
    tr[R].d += lz[R];
  }
}
void cal1(int u) {
  if (special[u]) {
    int x = tr[1].l;
    int y = tr[1].r;
    int a = lca(x, u);
    int b = lca(y, u);
    int c = lca(x, y);
    if (a == b) a = b = c;
    if (a == c) a = c = b;
    f[u]++;
    f[a]++;
    a = lca(a, u);
    f[a]--;
    a = p[a][0];
    f[a]--;
  }
  for (pair<int, int> e : g[u])
    if (e.first != p[u][0]) {
      int v = e.first;
      int w = e.second;
      upd(st[v], en[v], -w - w);
      upd(st[1], en[1], w);
      cal1(v);
      upd(st[v], en[v], w + w);
      upd(st[1], en[1], -w);
    }
}
void cal2(int u) {
  for (pair<int, int> e : g[u])
    if (e.first != p[u][0]) {
      cal2(e.first);
      f[u] += f[e.first];
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    special[x] = 1;
  }
  for (int i = 1; i < n; ++i) {
    int u;
    cin >> u;
    int v;
    cin >> v;
    int w;
    cin >> w;
    g[u].emplace_back(v, w);
    g[v].emplace_back(u, w);
  }
  dfs(1, 0);
  for (int i = n - 1; i; --i) tr[i] = tr[i << 1] + tr[i << 1 | 1];
  cal1(1);
  cal2(1);
  int ans = 0;
  int cnt = 0;
  for (int i = 1; i <= n; ++i)
    if (!special[i]) {
      if (ans < f[i]) {
        ans = f[i];
        cnt = 0;
      }
      if (ans == f[i]) cnt++;
    }
  cout << ans << " ";
  cout << cnt << "\n";
}
