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 EXP = 18;
const int DIM = 100005;
const int INF = 1000000005;
pair<int, int> dpd[DIM];
vector<pair<int, int>> edg[DIM];
int anc[DIM][EXP], lev[DIM], sol[DIM], aux[DIM];
bool oki[DIM];
void dfs1(int x, int f) {
  dpd[x] = make_pair(-INF, 0);
  anc[x][0] = f;
  lev[x] = lev[f] + 1;
  for (int i = 1; i < EXP; ++i) {
    anc[x][i] = anc[anc[x][i - 1]][i - 1];
  }
  if (oki[x]) {
    dpd[x] = make_pair(0, x);
  }
  for (auto it : edg[x])
    if (it.first != f) {
      dfs1(it.first, x);
      if (dpd[x].first < dpd[it.first].first + it.second) {
        dpd[x] =
            make_pair(dpd[it.first].first + it.second, dpd[it.first].second);
      } else if (dpd[x].first == dpd[it.first].first + it.second) {
        dpd[x] = make_pair(dpd[it.first].first + it.second, x);
      }
    }
}
int lca(int x, int y) {
  if (lev[x] > lev[y]) {
    swap(x, y);
  }
  for (int i = EXP - 1; i >= 0; --i) {
    if (lev[y] - (1 << i) >= lev[x]) {
      y = anc[y][i];
    }
  }
  for (int i = EXP - 1; i >= 0; --i) {
    if (anc[x][i] != anc[y][i]) {
      x = anc[x][i];
      y = anc[y][i];
    }
  }
  return x == y ? x : anc[x][0];
}
void update(int x, int y) {
  int z = lca(x, y);
  ++sol[x];
  ++sol[y];
  --sol[z];
  --sol[z];
  ++aux[z];
}
void dfs2(int x, int f, pair<int, int> up = make_pair(-INF, 0)) {
  if (oki[x] and up.first < 0) {
    up = make_pair(0, x);
  }
  if (oki[x]) {
    up.first > dpd[x].first ? update(x, up.second) : update(x, dpd[x].second);
  }
  pair<int, int> bst[3];
  bst[0] = bst[1] = bst[2] = make_pair(-INF, 0);
  for (auto it : edg[x])
    if (it.first != f) {
      if (bst[2].first < dpd[it.first].first + it.second) {
        bst[2] =
            make_pair(dpd[it.first].first + it.second, dpd[it.first].second);
        for (int i = 2; i >= 1 and bst[i].first > bst[i - 1].first; --i) {
          swap(bst[i - 1], bst[i]);
        }
      }
    }
  for (auto it : edg[x])
    if (it.first != f) {
      int nr = 0;
      bool ok = false;
      pair<int, int> nup = make_pair(-INF, 0);
      for (int i = 0; i <= 2; ++i) {
        if (bst[i].first == dpd[it.first].first + it.second and !ok) {
          ok = true;
        } else if (nup.first < bst[i].first + it.second) {
          nup = make_pair(bst[i].first + it.second, bst[i].second);
        } else if (nup.first == bst[i].first + it.second) {
          nup.second = x;
        }
      }
      if (nup.first < up.first + it.second) {
        nup = make_pair(up.first + it.second, up.second);
      } else if (nup.first == up.first + it.second) {
        nup.second = x;
      }
      dfs2(it.first, x, nup);
    }
}
void dfs3(int x, int f) {
  for (auto it : edg[x])
    if (it.first != f) {
      dfs3(it.first, x);
      sol[x] += sol[it.first];
    }
}
int main(void) {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int x;
    cin >> x;
    oki[x] = true;
  }
  for (int i = 1; i < n; ++i) {
    int x, y, c;
    cin >> x >> y >> c;
    edg[x].push_back(make_pair(y, c));
    edg[y].push_back(make_pair(x, c));
  }
  dfs1(1, 0);
  dfs2(1, 0);
  dfs3(1, 0);
  pair<int, int> ans = make_pair(-INF, 0);
  for (int i = 1; i <= n; ++i)
    if (!oki[i]) {
      sol[i] += aux[i];
      if (ans.first < sol[i]) {
        ans = make_pair(sol[i], 1);
      } else if (ans.first == sol[i]) {
        ++ans.second;
      }
    }
  cout << ans.first << " " << ans.second << endl;
  return 0;
}
