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>
#pragma warning(disable : 4996)
using namespace std;
int n, D[100100], par[100100], Len, pv, C[100100], res, res_n;
bool chk[100100];
vector<int> E[100100], L[100100];
void DFS(int a, int p) {
  int i;
  par[a] = p;
  for (i = 0; i < E[a].size(); i++) {
    if (E[a][i] != p) {
      D[E[a][i]] = D[a] + L[a][i];
      DFS(E[a][i], a);
    }
  }
}
int DFS2(int a, int p) {
  int i, r = 0, t;
  if (chk[a]) {
    if (D[a] > Len) Len = D[a], pv = a;
    r = D[a];
  }
  for (i = 0; i < E[a].size(); i++) {
    if (E[a][i] != p) {
      D[E[a][i]] = D[a] + L[a][i];
      t = DFS2(E[a][i], a);
      if (t == r && t == Len) pv = a;
      if (t > r) r = t;
    }
  }
  return r;
}
void DFS3(int a, int p, int root, int pv) {
  if (chk[a]) C[pv]++, C[root]--;
  int i;
  for (i = 0; i < E[a].size(); i++) {
    if (E[a][i] != p) DFS3(E[a][i], a, root, pv);
  }
}
int DFS4(int a, int p) {
  int i, k = C[a];
  for (i = 0; i < E[a].size(); i++) {
    if (E[a][i] != p) {
      k += DFS4(E[a][i], a);
    }
  }
  if (!chk[a]) {
    if (res < k)
      res = k, res_n = 1;
    else if (res == k)
      res_n++;
  }
  return k;
}
int main() {
  int m, a, i, b, c, t;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d", &a);
    C[a]++;
    chk[a] = true;
  }
  for (i = 1; i < n; i++) {
    scanf("%d%d%d", &a, &b, &c);
    E[a].push_back(b);
    L[a].push_back(c);
    E[b].push_back(a);
    L[b].push_back(c);
  }
  DFS(a, -1);
  b = 0;
  for (i = 1; i <= n; i++)
    if (chk[i] && b < D[i]) b = D[i], a = i;
  D[a] = 0;
  DFS(a, -1);
  b = 0;
  for (i = 1; i <= n; i++)
    if (chk[i] && b < D[i]) b = D[i], c = i;
  b = 999999999;
  a = c;
  while (a != -1) {
    if (abs(D[c] - D[a] * 2) < b) b = abs(D[c] - D[a] * 2), t = a;
    a = par[a];
  }
  a = t;
  int LL = 0, p[2], pp[2];
  c = 0;
  for (i = 0; i < E[a].size(); i++) {
    D[E[a][i]] = L[a][i];
    Len = 0;
    DFS2(E[a][i], a);
    if (LL < Len) {
      LL = Len, c = 0;
      p[c] = E[a][i];
      pp[c++] = pv;
    } else if (LL == Len) {
      if (c == 1) p[c] = E[a][i], pp[c] = pv;
      c++;
    }
  }
  if (c == 2) {
    DFS3(p[0], a, a, pp[1]);
    DFS3(p[1], a, a, pp[0]);
  }
  if (c == 1) {
    for (i = 0; i < E[a].size(); i++) {
      if (p[0] != E[a][i]) {
        DFS3(E[a][i], a, a, pp[0]);
      }
    }
  }
  res = -1;
  DFS4(a, -1);
  printf("%d %d\n", res, res_n);
}
