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 int MAXN = 1e5 + 5;
unordered_map<long long, int> endspot, l;
unordered_map<long long, bool> visited;
pair<int, int> best[MAXN][3];
vector<int> edges[MAXN];
int pilg[MAXN];
int n, m;
set<int> notdone[MAXN];
int dfsorder[MAXN], tree[8 * MAXN], revdfs[MAXN];
int ct = 0;
vector<int> euler;
int firsttime[MAXN];
int partpl[MAXN], partmi[MAXN];
int ans[MAXN];
int part = 0;
bool ispilg[MAXN];
void dfs(int f, int v) {
  dfsorder[v] = ct;
  revdfs[ct] = v;
  ++ct;
  euler.push_back(dfsorder[v]);
  firsttime[v] = euler.size() - 1;
  for (int i = 0; i < edges[v].size(); ++i) {
    if (f != edges[v][i]) {
      dfs(v, edges[v][i]);
      euler.push_back(dfsorder[v]);
    }
  }
}
void init(int l = 0, int r = 2 * n - 2, int node = 1) {
  if (l == r) {
    tree[node] = euler[l];
    return;
  }
  int mid = (l + r) / 2;
  init(l, mid, 2 * node);
  init(mid + 1, r, 2 * node + 1);
  tree[node] = min(tree[2 * node], tree[2 * node + 1]);
}
int lca(int a, int b, int l = 0, int r = 2 * n - 2, int node = 1) {
  if (a == l && b == r) return tree[node];
  int mid = (l + r) / 2;
  if (b <= mid) return lca(a, b, l, mid, 2 * node);
  if (a >= mid + 1) return lca(a, b, mid + 1, r, 2 * node + 1);
  return min(lca(a, mid, l, mid, 2 * node),
             lca(mid + 1, b, mid + 1, r, 2 * node + 1));
}
void update(int x, int v) {
  if (!ispilg[v] && (best[v][0] == pair<int, int>(0, v))) return;
  if (best[v][0].second == x) {
    if (best[v][1].first == best[v][2].first)
      endspot[1LL * MAXN * x + v] = v;
    else
      endspot[1LL * MAXN * x + v] = endspot[1LL * MAXN * v + best[v][1].second];
    int lx = l[1LL * MAXN * x + v] + best[v][1].first;
    pair<int, int> xl = {lx, v};
    for (int i = 0; i < 3; ++i) {
      if (xl > best[x][i]) {
        for (int j = 2; j >= i + 1; --j) best[x][j] = best[x][j - 1];
        best[x][i] = xl;
        break;
      }
    }
  } else if (best[v][1].second == x) {
    if (best[v][0].first == best[v][2].first)
      endspot[1LL * MAXN * x + v] = v;
    else
      endspot[1LL * MAXN * x + v] = endspot[1LL * MAXN * v + best[v][0].second];
    int lx = l[1LL * MAXN * x + v] + best[v][0].first;
    pair<int, int> xl = {lx, v};
    for (int i = 0; i < 3; ++i) {
      if (xl > best[x][i]) {
        for (int j = 2; j >= i + 1; --j) best[x][j] = best[x][j - 1];
        best[x][i] = xl;
        break;
      }
    }
  } else {
    if (best[v][0].first == best[v][1].first)
      endspot[1LL * MAXN * x + v] = v;
    else
      endspot[1LL * MAXN * x + v] = endspot[1LL * MAXN * v + best[v][0].second];
    int lx = l[1LL * MAXN * x + v] + best[v][0].first;
    pair<int, int> xl = {lx, v};
    for (int i = 0; i < 3; ++i) {
      if (xl > best[x][i]) {
        for (int j = 2; j >= i + 1; --j) best[x][j] = best[x][j - 1];
        best[x][i] = xl;
        break;
      }
    }
  }
}
void compute(int x, int v) {
  if (visited.count(1LL * MAXN * x + v) > 0) return;
  visited[1LL * MAXN * x + v] = 1;
  while (!notdone[v].empty() && *notdone[v].begin() != x) {
    compute(v, *notdone[v].begin());
    notdone[v].erase(*notdone[v].begin());
  }
  while (!notdone[v].empty() && *notdone[v].rbegin() != x) {
    compute(v, *notdone[v].rbegin());
    notdone[v].erase(*notdone[v].rbegin());
  }
  update(x, v);
}
int finishdfs(int f, int v) {
  int tot = 0;
  for (int i = 0; i < edges[v].size(); ++i) {
    if (f != edges[v][i]) {
      tot += finishdfs(v, edges[v][i]);
    }
  }
  tot += partpl[v];
  ans[v] += tot;
  tot -= partmi[v];
  return tot;
}
int main() {
  ios_base::sync_with_stdio(0);
  memset(partpl, 0, sizeof(partpl));
  memset(partmi, 0, sizeof(partmi));
  memset(ans, 0, sizeof(ans));
  memset(ispilg, 0, sizeof(ispilg));
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> pilg[i];
    pilg[i]--;
    ispilg[pilg[i]] = true;
  }
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    int l3;
    cin >> l3;
    edges[x].push_back(y);
    edges[y].push_back(x);
    notdone[x].insert(y);
    notdone[y].insert(x);
    l[1LL * MAXN * x + y] = l[1LL * MAXN * y + x] = l3;
  }
  for (int i = 0; i < n; ++i) {
    best[i][0] = best[i][1] = best[i][2] = {0, i};
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < edges[i].size(); ++j) compute(i, edges[i][j]);
  dfs(-1, 0);
  init();
  for (int i = 0; i < m; ++i) {
    int p = pilg[i], q;
    if (best[p][0].first == best[p][1].first) {
      q = p;
    } else
      q = endspot[1LL * MAXN * p + best[p][0].second];
    if (p == q) continue;
    if (firsttime[p] > firsttime[q]) swap(p, q);
    int lcapq = revdfs[lca(firsttime[p], firsttime[q])];
    if (lcapq == p) {
      partpl[q]++;
      partmi[p]++;
    } else {
      partpl[p]++;
      partpl[q]++;
      partmi[lcapq] += 2;
      ans[lcapq]--;
    }
  }
  finishdfs(-1, 0);
  int maxi = -1, maxct = -1;
  for (int i = 0; i < n; ++i) {
    if (ispilg[i]) continue;
    if (ans[i] == maxi) ++maxct;
    if (ans[i] > maxi) {
      maxi = ans[i];
      maxct = 1;
    }
  }
  cout << maxi << ' ' << maxct << endl;
}
