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 NMax = 110000;
struct edge {
  int num, len;
  edge *next;
} * G[NMax], pool[NMax * 2];
int N, M, L, A[NMax];
void Build(int x, int y, int z) {
  edge *p = &pool[L++], *q = &pool[L++];
  p->num = y;
  p->len = z;
  p->next = G[x];
  G[x] = p;
  q->num = x;
  q->len = z;
  q->next = G[y];
  G[y] = q;
}
int D[NMax], next[NMax];
int DFS1(int a, int d, int fa) {
  D[a] = d;
  int maxx = -1, ret = -1;
  next[a] = -1;
  if (A[a]) maxx = d, ret = a, next[a] = a;
  for (edge *p = G[a]; p; p = p->next)
    if (p->num != fa) {
      int tmp = DFS1(p->num, d + p->len, a);
      if (tmp != -1 && D[tmp] > maxx) {
        maxx = D[tmp];
        ret = tmp;
        next[a] = p->num;
      }
    }
  return ret;
}
int cen;
int cnt[NMax], maxD[NMax], cntmax[NMax], cntsec[NMax], secmax[NMax];
int ans[NMax];
void DFS2(int a, int d, int fa) {
  maxD[a] = -1;
  cntmax[a] = -1;
  secmax[a] = -1;
  cntsec[a] = -1;
  if (A[a] == 1) {
    cnt[a] = 1;
    maxD[a] = d;
    cntmax[a] = 1;
  }
  for (edge *p = G[a]; p; p = p->next)
    if (fa != p->num) {
      DFS2(p->num, d + p->len, a);
      cnt[a] += cnt[p->num];
      if (maxD[p->num] != -1 && maxD[p->num] > maxD[a]) {
        maxD[a] = maxD[p->num];
        cntmax[a] = cntmax[p->num];
      } else if (maxD[p->num] != -1 && maxD[p->num] == maxD[a])
        cntmax[a] += cntmax[p->num];
    }
  for (edge *p = G[a]; p; p = p->next)
    if (fa != p->num) {
      if (maxD[p->num] != -1 && maxD[p->num] < maxD[a] &&
          maxD[p->num] > secmax[a]) {
        secmax[a] = maxD[p->num];
        cntsec[a] += cntmax[p->num];
      } else if (maxD[p->num] != -1 && maxD[p->num] < maxD[a] &&
                 maxD[p->num] == secmax[a])
        cntsec[a] += cntmax[p->num];
      if (secmax[p->num] != -1 && secmax[p->num] < maxD[a] &&
          secmax[p->num] > secmax[a]) {
        secmax[a] = secmax[p->num];
        cntsec[a] += cntsec[p->num];
      } else if (secmax[p->num] != -1 && secmax[p->num] < maxD[a] &&
                 secmax[p->num] == secmax[a])
        cntsec[a] += cntsec[p->num];
    }
  if (!A[a]) ans[a] += cnt[a];
}
void DFS4(int a, int fa, int add) {
  int x = 0;
  if (!A[a]) ans[a] += add;
  for (edge *p = G[a]; p; p = p->next)
    if (p->num != fa) {
      if (maxD[p->num] == maxD[a]) x++;
    }
  if (x == 1) {
    for (edge *p = G[a]; p; p = p->next)
      if (p->num != fa && maxD[p->num] == maxD[a]) DFS4(p->num, a, add);
  }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= M; i++) {
    int x;
    scanf("%d", &x);
    A[x] = 1;
  }
  for (int i = 1; i < N; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    Build(x, y, z);
  }
  cen = -1;
  for (int i = 1; i <= N; i++)
    if (A[i]) {
      int tmp = DFS1(i, 0, -1);
      int tmq = DFS1(tmp, 0, -1);
      int p = tmp;
      while (D[p] < D[tmq] / 2) p = next[p];
      cen = p;
      break;
    }
  DFS2(cen, 0, -1);
  int flag = 0, flag1 = 0;
  for (edge *p = G[cen]; p; p = p->next) {
    if (maxD[p->num] == maxD[cen]) flag++;
    if (maxD[p->num] == secmax[cen]) flag1++;
  }
  int sum = cnt[cen];
  for (edge *p = G[cen]; p; p = p->next)
    if (maxD[p->num] != -1) {
      if (maxD[p->num] == maxD[cen] && flag == 1)
        DFS4(p->num, cen, sum - cnt[p->num]);
      if (flag == 2 && maxD[p->num] == maxD[cen]) {
        int x = 0;
        for (edge *q = G[cen]; q; q = q->next)
          if (maxD[q->num] == maxD[cen] && q->num != p->num) {
            x = cnt[q->num];
            break;
          }
        DFS4(p->num, cen, x);
      }
      if (flag == 1 && maxD[p->num] == secmax[cen] && flag1 == 1) {
        int x = 0;
        for (edge *q = G[cen]; q; q = q->next)
          if (maxD[q->num] == maxD[cen]) x += cntmax[q->num];
        DFS4(p->num, cen, x);
      }
    }
  int maxx = 0, cnt = 0;
  for (int i = 1; i <= N; i++)
    if (!A[i]) {
      if (ans[i] > maxx) {
        maxx = ans[i];
        cnt = 1;
      } else if (ans[i] == maxx)
        cnt++;
    }
  printf("%d %d\n", maxx, cnt);
  getchar();
  getchar();
  return 0;
}
