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 N = 100002;
int n, m, ok[N], a, b, c, l[N], nr[N];
vector<pair<int, int>> G[N];
int p[20][N];
void parentDFS(int x, int par) {
  p[0][x] = par;
  l[x] = l[par] + 1;
  for (auto it : G[x])
    if (it.first != par) parentDFS(it.first, x);
}
int lca(int x, int y) {
  if (l[x] < l[y]) swap(x, y);
  for (int i = 0; i < 18; i++)
    if (((l[x] - l[y]) & (1 << i))) x = p[i][x];
  if (x == y) return x;
  for (int i = 17; i >= 0; i--)
    if (p[i][x] != p[i][y]) {
      x = p[i][x];
      y = p[i][y];
    }
  return p[0][x];
}
pair<int, int> dist[N], ans[N];
pair<int, int> maxx(pair<int, int> a, pair<int, int> b, int nod) {
  if (a.first < 0) return b;
  if (b.first < 0) return a;
  if (a.first == b.first)
    return {a.first, nod};
  else
    return max(a, b);
}
void dfs1(int x, int p) {
  if (ok[x]) {
    dist[x] = {0, x};
  } else
    dist[x] = {-1e9, -1};
  for (auto it : G[x]) {
    int u = it.first, c = it.second;
    if (u == p) continue;
    dfs1(u, x);
    dist[x] = maxx(dist[x], {dist[u].first + c, dist[u].second}, x);
  }
}
void dfs2(int x, int par, pair<int, int> sus) {
  ans[x] = maxx(sus, dist[x], x);
  if (ok[x]) {
    int t = ans[x].second;
    int L = lca(x, t);
    nr[x]++;
    nr[t]++;
    nr[L]--;
    if (p[0][L] != 0) nr[p[0][L]]--;
  }
  pair<int, int> aux;
  if (ok[x])
    aux = {0, x};
  else
    aux = {-1e9, -1};
  vector<pair<int, int>> child;
  vector<pair<int, int>> pr;
  int j = 0;
  for (auto it : G[x])
    if (it.first != par) child.push_back(it);
  for (auto it : child) {
    int u = it.first, c = it.second;
    pr.push_back(aux);
    aux = maxx(aux, {dist[u].first + c, dist[u].second}, x);
  }
  for (int i = child.size() - 1; i >= 0; i--) {
    int u = child[i].first;
    int c = child[i].second;
    pair<int, int> aux1 = maxx(sus, pr[i], x);
    aux1.first += c;
    dfs2(u, x, aux1);
    sus = maxx(sus, {dist[u].first + c, dist[u].second}, x);
  }
}
void mars(int x, int p) {
  for (auto it : G[x]) {
    int u = it.first;
    if (u == p) continue;
    mars(u, x);
  }
  nr[p] += nr[x];
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    ok[a] = 1;
  }
  for (int i = 1; i < n; i++) {
    cin >> a >> b >> c;
    G[a].push_back({b, c});
    G[b].push_back({a, c});
  }
  parentDFS(1, 0);
  for (int i = 1; i < 18; i++)
    for (int j = 1; j <= n; j++) p[i][j] = p[i - 1][p[i - 1][j]];
  dfs1(1, 0);
  dfs2(1, 0, {-1e9, -1});
  mars(1, 0);
  int r = 0, sol = 0;
  for (int i = 1; i <= n; i++) {
    if (!ok[i]) {
      if (sol < nr[i]) {
        sol = nr[i];
        r = 1;
      } else if (sol == nr[i])
        r++;
    }
  }
  cout << sol << " " << r;
  return 0;
}
