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 = 100010;
int f[maxn];
int d[maxn];
vector<pair<int, int> > G[maxn];
int mx[maxn], mx_pos[maxn], dye[maxn], sum[maxn];
int v[maxn];
int ans, ans_cnt, root, pos, n, m;
void add(int x, int y, int z) {
  G[x].push_back(make_pair(y, z));
  G[y].push_back(make_pair(x, z));
}
bool dfs(int x, int fa, int now) {
  int flag = (v[x] == 1);
  d[x] = now;
  for (auto y : G[x]) {
    if (y.first == fa) continue;
    int tmp = dfs(y.first, x, now + y.second);
    flag |= tmp;
    f[y.first] = x;
  }
  if (flag && d[x] > ans) {
    ans = d[x];
    pos = x;
  }
  return flag;
}
void get_root() {
  dfs(1, -1, 0);
  memset(d, 0, sizeof(d));
  ans = 0;
  root = pos;
  dfs(root, -1, 0);
  int Sum = d[pos], tmp = pos;
  while (d[tmp] > d[pos] / 2) {
    tmp = f[tmp];
  }
  root = tmp;
}
void update(int pos, int ch, int val) {
  if (mx[pos] < mx[ch] + val) {
    mx[pos] = mx[ch] + val;
    mx_pos[pos] = mx_pos[ch];
  } else if (mx[pos] == mx[ch] + val) {
    mx_pos[pos] = pos;
  }
}
bool dfs1(int x, int fa, int color) {
  dye[x] = color;
  int flag = (v[x] == 1);
  if (flag == 1) mx_pos[x] = x;
  for (auto y : G[x]) {
    if (y.first == fa) continue;
    int tmp;
    tmp = dfs1(y.first, x, color);
    f[y.first] = x;
    if (tmp) {
      update(x, y.first, y.second);
    }
    flag |= tmp;
  }
  return flag;
}
void dfs2(int x, int fa) {
  for (auto y : G[x]) {
    if (y.first == fa) continue;
    dfs2(y.first, x);
    sum[x] += sum[y.first];
  }
  if (sum[x] > ans && v[x] == 0) {
    ans = sum[x];
    ans_cnt = 1;
  } else if (sum[x] == ans && v[x] == 0) {
    ans_cnt++;
  }
}
vector<pair<int, int> > res;
map<int, int> mp;
set<int> s;
int tot;
void solve() {
  for (auto y : G[root]) {
    int tmp = dfs1(y.first, root, ++tot);
    if (tmp) {
      res.push_back(make_pair(mx[y.first] + y.second, mx_pos[y.first]));
    }
  }
  if (v[root] == 1) {
    res.push_back(make_pair(0, root));
  }
  sort(res.begin(), res.end());
  s.insert(dye[res[res.size() - 1].second]);
  for (int i = res.size() - 1; i >= 1; i--) {
    if (res[i].first == res[i - 1].first) {
      s.insert(dye[res[i].second]);
      s.insert(dye[res[i - 1].second]);
    } else {
      break;
    }
  }
  for (int i = 0; i < res.size(); i++) {
    mp[res[i].first]++;
  }
  for (int i = 1; i <= n; i++) {
    if (v[i] == 1) {
      if (s.count(dye[i]) && s.size() > 1) {
        if (s.size() > 2) {
          sum[i]++;
        } else {
          for (int j = res.size() - 1; j >= 0; j--) {
            if (dye[i] != dye[res[j].second]) {
              sum[i]++;
              sum[res[j].second]++;
              sum[root]--;
              break;
            }
          }
        }
      } else {
        if (s.size() > 1) {
          sum[i]++;
          continue;
        }
        if (dye[i] != dye[res[res.size() - 1].second]) {
          sum[i]++;
          sum[res[res.size() - 1].second]++;
          sum[root]--;
        } else {
          sum[i]++;
          if (mp[res[res.size() - 2].first] == 1) {
            sum[res[res.size() - 2].second]++;
            sum[root]--;
          }
        }
      }
    }
  }
  ans = ans_cnt = 0;
  dfs2(root, -1);
}
int main() {
  int x, y, z;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    v[x] = 1;
  }
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &x, &y, &z);
    add(x, y, z);
  }
  get_root();
  solve();
  printf("%d %d\n", ans, ans_cnt);
  return 0;
}
