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;
typedef pair<int, int> path;
bool special[100010];
vector<pair<int, int> > E[100010];
path up[100010];
path down[100010];
int depth[100010];
int par[100010][18];
int add[100010];
int cover[100010];
ostream& operator<<(ostream& out, const pair<int, int>& p) {
  return out << "(" << p.first << "," << p.second << ")";
}
path take_better(const path& a, const path& b, int i) {
  if (a.first > b.first) return a;
  if (a.first < b.first) return b;
  return make_pair(a.first, i);
}
void dfs1(int i, int p) {
  if (special[i])
    down[i] = make_pair(0, i);
  else
    down[i] = make_pair(-1000000000, i);
  par[i][0] = p;
  depth[i] = depth[p] + 1;
  int numE = E[i].size();
  for (int x = 0; x < (numE); ++x) {
    int j = E[i][x].first, c = E[i][x].second;
    if (j == p) continue;
    dfs1(j, i);
    path dd = down[j];
    dd.first += c;
    down[i] = take_better(down[i], dd, i);
  }
}
void dfs2(int i, int p, path withoutMe) {
  up[i] = withoutMe;
  int numE = E[i].size();
  path best = up[i], second = make_pair(-1000000000, i),
       third = make_pair(-1000000000, i);
  for (int x = 0; x < (numE); ++x) {
    int j = E[i][x].first, c = E[i][x].second;
    if (j == p) continue;
    path here = down[j];
    here.first += c;
    if (here >= best) {
      third = second;
      second = best;
      best = here;
    } else if (here >= second) {
      third = second;
      second = here;
    } else if (here >= third) {
      third = here;
    }
  }
  for (int x = 0; x < (numE); ++x) {
    int j = E[i][x].first, c = E[i][x].second;
    if (j == p) continue;
    path withoutHim;
    path goHere = down[j];
    goHere.first += c;
    if (goHere == best)
      withoutHim = take_better(second, third, i);
    else
      withoutHim = take_better(best, third, i);
    withoutHim.first += c;
    dfs2(j, i, withoutHim);
  }
}
int nth(int a, int n) {
  assert(n >= 0);
  for (int k = 0; n; n >>= 1, ++k)
    if (n & 1) a = par[a][k];
  return a;
}
int lca(int a, int b) {
  if (depth[a] < depth[b]) swap(a, b);
  a = nth(a, depth[a] - depth[b]);
  assert(depth[a] == depth[b]);
  for (int k = 18 - 1; k >= 0; --k)
    if (par[a][k] != par[b][k]) a = par[a][k], b = par[b][k];
  if (a != b) a = b = par[a][0];
  return a;
}
bool is_ancestor(int a, int b) { return lca(a, b) == a; }
void update(int i, int v) { add[i] += v; }
void add_path(int i, int j) {
  if (is_ancestor(i, j)) {
    update(j, 1);
    update(par[i][0], -1);
  } else if (is_ancestor(j, i)) {
    update(i, 1);
    update(par[j][0], -1);
  } else {
    int k = lca(i, j);
    update(i, 1);
    update(j, 1);
    update(k, -1);
    update(par[k][0], -1);
  }
}
void setup(int N) {
  for (int k = (1); k <= (18 - 1); ++k)
    for (int i = (1); i <= (N); ++i) par[i][k] = par[par[i][k - 1]][k - 1];
  for (int i = (1); i <= (N); ++i) {
    if (!special[i]) continue;
    path p = take_better(up[i], down[i], i);
    int j = p.second;
    add_path(i, j);
  }
}
int dfs3(int i, int p) {
  int sum = add[i];
  int numE = E[i].size();
  for (int x = 0; x < (numE); ++x) {
    int j = E[i][x].first;
    if (j == p) continue;
    sum += dfs3(j, i);
  }
  assert(sum >= 0);
  cover[i] = sum;
  return sum;
}
int main() {
  int N, M, a, b, c;
  cin >> N >> M;
  for (int i = 0; i < (M); ++i) {
    scanf("%d", &a);
    special[a] = true;
  }
  for (int i = 0; i < (N - 1); ++i) {
    scanf("%d%d%d", &a, &b, &c);
    E[a].push_back(make_pair(b, c));
    E[b].push_back(make_pair(a, c));
  }
  path init(-1000000000, 1);
  if (special[1]) init = make_pair(0, 1);
  dfs1(1, 0);
  dfs2(1, 0, init);
  setup(N);
  dfs3(1, 0);
  int mx = 0;
  int cnt = 0;
  for (int i = (1); i <= (N); ++i) {
    if (special[i]) continue;
    if (cover[i] == mx) {
      cnt++;
    } else if (cover[i] > mx) {
      mx = cover[i];
      cnt = 1;
    }
  }
  cout << mx << " " << cnt << endl;
}
