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 T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
const char lf = '\n';
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
const int _ = 100007;
vector<pair<int, int>> e[_];
int n, m, val[_] = {0}, fa[_] = {0};
void dfs(int x, int ff, int dep[]) {
  fa[x] = ff;
  for (auto [b, c] : e[x])
    if (b != ff) dep[b] = dep[x] + c, dfs(b, x, dep);
}
int dep1[_] = {0}, dep2[_] = {0}, mxdep, sz[_] = {0};
int ed[_] = {0}, ps[_] = {0}, lps = 0;
int allans = 0, allcnt = 0;
void upd(int x) {
  if (x > allans) allans = x, allcnt = 0;
  if (x == allans) allcnt++;
}
int dfs2(int x, int ff, int d) {
  int ans = val[x];
  for (auto [b, c] : e[x])
    if (b != ff && !ed[b]) ans += dfs2(b, x, d + c);
  if (!val[x]) upd(ans);
  return ans;
}
int xdep[_] = {0}, ll[_] = {0}, rr[_] = {0};
int main() {
  ios::sync_with_stdio(0), cout.tie(nullptr);
  n = ty(), m = ty();
  for (int i = 1; i <= m; i++) val[ty()] = 1;
  for (int i = 1, a, b, c; i < n; i++)
    a = ty(), b = ty(), c = ty(), e[a].emplace_back(b, c),
    e[b].emplace_back(a, c);
  dfs(1, 0, dep1);
  int rt1 = 1;
  for (int i = 2; i <= n; i++)
    if (!val[rt1] || (val[i] && dep1[rt1] < dep1[i])) rt1 = i;
  dep1[rt1] = 0, dfs(rt1, 0, dep1);
  int rt2 = 1;
  for (int i = 2; i <= n; i++)
    if (!val[rt2] || (val[i] && dep1[rt2] < dep1[i])) rt2 = i;
  dfs(rt2, 0, dep2);
  for (int i = rt1; i; i = fa[i]) ps[++lps] = i, ed[i] = 1;
  int sl = 0, sr = 0;
  for (int i = 1; i <= lps; i++) sz[ps[i]] = dfs2(ps[i], 0, 0);
  for (int i = 1; i <= lps; i++)
    if (dep1[ps[i]] < dep2[ps[i]]) rr[ps[i]] += sz[ps[i]], sr += sz[ps[i]];
  for (int i = lps; i >= 1; i--)
    if (dep1[ps[i]] > dep2[ps[i]]) ll[ps[i]] += sz[ps[i]];
  for (int i = lps; i >= 1; i--) {
    int a = ps[i];
    sr -= rr[a];
    if (!val[a]) upd(sl + sr + sz[a]);
    sl += ll[a];
  }
  cout << allans << ' ' << allcnt << lf;
  return 0;
}
