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;
template <typename T>
struct dual_segment_tree {
  int N;
  vector<T> ST;
  dual_segment_tree() {}
  dual_segment_tree(int n) {
    N = 1;
    while (N < n) {
      N *= 2;
    }
    ST = vector<T>(N * 2 - 1, 0);
  }
  T operator[](int k) {
    k += N - 1;
    T ans = ST[k];
    while (k > 0) {
      k = (k - 1) / 2;
      ans += ST[k];
    }
    return ans;
  }
  void range_add(int L, int R, T x, int i, int l, int r) {
    if (R <= l || r <= L) {
      return;
    } else if (L <= l && r <= R) {
      ST[i] += x;
      return;
    } else {
      int m = (l + r) / 2;
      range_add(L, R, x, i * 2 + 1, l, m);
      range_add(L, R, x, i * 2 + 2, m, r);
      return;
    }
  }
  void range_add(int L, int R, T x) { range_add(L, R, x, 0, 0, N); }
};
struct heavy_light_decomposition {
  vector<int> p, sz, in, next;
  dual_segment_tree<int> ST;
  heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, int r)
      : p(p) {
    int N = p.size();
    sz = vector<int>(N);
    dfs1(c, r);
    int t = 0;
    in = vector<int>(N);
    next = vector<int>(N, r);
    dfs2(c, t, r);
    ST = dual_segment_tree<int>(N);
  }
  void dfs1(vector<vector<int>> &c, int v) {
    sz[v] = 1;
    for (int &w : c[v]) {
      dfs1(c, w);
      sz[v] += sz[w];
      if (sz[w] > sz[c[v][0]]) {
        swap(w, c[v][0]);
      }
    }
  }
  void dfs2(vector<vector<int>> &c, int &t, int v) {
    in[v] = t;
    t++;
    for (int w : c[v]) {
      if (w == c[v][0]) {
        next[w] = next[v];
      } else {
        next[w] = w;
      }
      dfs2(c, t, w);
    }
  }
  int lca(int u, int v) {
    while (true) {
      if (in[u] > in[v]) {
        swap(u, v);
      }
      if (next[u] == next[v]) {
        return u;
      }
      v = p[next[v]];
    }
  }
  int lca(int u, int v, int w) { return lca(u, v) ^ lca(v, w) ^ lca(w, u); }
  void path_add(int u, int v) {
    int w = lca(u, v);
    while (next[u] != next[w]) {
      ST.range_add(in[next[u]], in[u] + 1, 1);
      u = p[next[u]];
    }
    ST.range_add(in[w], in[u] + 1, 1);
    while (next[v] != next[w]) {
      ST.range_add(in[next[v]], in[v] + 1, 1);
      v = p[next[v]];
    }
    ST.range_add(in[w] + 1, in[v] + 1, 1);
  }
  int operator[](int v) { return ST[in[v]]; }
};
void dfs(vector<vector<pair<int, int>>> &E, vector<int> &in, vector<int> &out,
         int &t, int v) {
  in[v] = t;
  t++;
  for (auto P : E[v]) {
    int w = P.second;
    if (in[w] == -1) {
      dfs(E, in, out, t, w);
    }
  }
  out[v] = t;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> id;
  vector<bool> mo(n, false);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    x--;
    id.push_back(x);
    mo[x] = true;
  }
  vector<vector<pair<int, int>>> E(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    E[a].push_back(make_pair(c, b));
    E[b].push_back(make_pair(c, a));
  }
  vector<int> d1(n, -1);
  d1[id[0]] = 0;
  vector<int> p(n, -1);
  vector<vector<int>> c(n);
  queue<int> Q1;
  Q1.push(id[0]);
  while (!Q1.empty()) {
    int v = Q1.front();
    Q1.pop();
    for (auto P : E[v]) {
      int w = P.second;
      if (d1[w] == -1) {
        p[w] = v;
        c[v].push_back(w);
        d1[w] = d1[v] + P.first;
        Q1.push(w);
      }
    }
  }
  int s = id[0];
  for (int x : id) {
    if (d1[x] > d1[s]) {
      s = x;
    }
  }
  vector<int> ds(n, -1);
  ds[s] = 0;
  queue<int> Q2;
  Q2.push(s);
  while (!Q2.empty()) {
    int v = Q2.front();
    Q2.pop();
    for (auto P : E[v]) {
      int w = P.second;
      if (ds[w] == -1) {
        ds[w] = ds[v] + P.first;
        Q2.push(w);
      }
    }
  }
  int t = id[0];
  for (int x : id) {
    if (ds[x] > ds[t]) {
      t = x;
    }
  }
  vector<int> dt(n, -1);
  dt[t] = 0;
  queue<int> Q3;
  Q3.push(t);
  while (!Q3.empty()) {
    int v = Q3.front();
    Q3.pop();
    for (auto P : E[v]) {
      int w = P.second;
      if (dt[w] == -1) {
        dt[w] = dt[v] + P.first;
        Q3.push(w);
      }
    }
  }
  heavy_light_decomposition HLD(p, c, id[0]);
  vector<int> in1(n, -1), out1(n, -1);
  int t1 = 0;
  dfs(E, in1, out1, t1, s);
  vector<int> euler1(n);
  for (int i = 0; i < n; i++) {
    euler1[in1[i]] = i;
  }
  vector<int> L1(n + 1, t), R1(n + 1, t);
  for (int i = 0; i < n; i++) {
    L1[i + 1] = L1[i];
    if (mo[euler1[i]] && ds[euler1[i]] == ds[t]) {
      L1[i + 1] = HLD.lca(L1[i + 1], euler1[i], s);
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    R1[i] = R1[i + 1];
    if (mo[euler1[i]] && ds[euler1[i]] == ds[t]) {
      R1[i] = HLD.lca(R1[i], euler1[i], s);
    }
  }
  vector<int> in2(n, -1), out2(n, -1);
  int t2 = 0;
  dfs(E, in2, out2, t2, t);
  vector<int> euler2(n);
  for (int i = 0; i < n; i++) {
    euler2[in2[i]] = i;
  }
  vector<int> L2(n + 1, s), R2(n + 1, s);
  for (int i = 0; i < n; i++) {
    L2[i + 1] = L2[i];
    if (mo[euler2[i]] && dt[euler2[i]] == dt[s]) {
      L2[i + 1] = HLD.lca(L2[i + 1], euler2[i], t);
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    R2[i] = R2[i + 1];
    if (mo[euler2[i]] && dt[euler2[i]] == dt[s]) {
      R2[i] = HLD.lca(R2[i], euler2[i], t);
    }
  }
  for (int x : id) {
    if (ds[x] < dt[x]) {
      int l = HLD.lca(s, L1[in1[x]], R1[out1[x]]);
      HLD.path_add(x, l);
    }
    if (dt[x] < ds[x]) {
      int l = HLD.lca(t, L2[in2[x]], R2[out2[x]]);
      HLD.path_add(x, l);
    }
  }
  vector<int> cnt(n);
  for (int i = 0; i < n; i++) {
    cnt[i] = HLD[i];
  }
  int ans1 = 0;
  for (int i = 0; i < n; i++) {
    if (!mo[i]) {
      ans1 = max(ans1, cnt[i]);
    }
  }
  int ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (!mo[i] && cnt[i] == ans1) {
      ans2++;
    }
  }
  cout << ans1 << ' ' << ans2 << endl;
}
