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;
int i, j, k, n, m, x, y, z, num[(int)(1e5 + 10)];
int lp[(int)(1e5 + 10)], mx2[(int)(1e5 + 10)], mx1[(int)(1e5 + 10)],
    mx3[(int)(1e5 + 10)];
int V[(int)(1e5 + 10)], T[(int)(1e5 + 10)], ans[(int)(1e5 + 10)],
    a[(int)(1e5 + 10)], A[(int)(1e5 + 10)];
int Nm[(int)(1e5 + 10)], dep[(int)(1e5 + 10)];
vector<pair<int, int> > arr[(int)(1e5 + 10)];
void f4(int x, int root, int a, int va, int nm) {
  ans[x] = Nm[x] + nm;
  if (lp[a] == va + mx2[x]) a = va = nm = 0;
  int a1 = 0, va1 = 0, nm1 = 0;
  int a2 = 0, va2 = 0;
  int a3 = 0, va3 = 0;
  if (lp[x] != T[x] and lp[x] != mx2[x] and ::a[x]) {
    nm++;
    if (!a)
      a = x;
    else if (!a1)
      a2 = x;
  }
  for (int i = 0; i < arr[x].size(); i++)
    if (arr[x][i].first != root) {
      int y = arr[x][i].first;
      int v = arr[x][i].second;
      int p = mx2[x];
      if (mx1[y] + v == p and mx1[x] != mx2[x]) p = mx3[x];
      p = max(p, T[x]);
      if (V[y] + v + p != lp[A[y]]) {
        nm += num[y];
        if (!a) {
          a = A[y];
          va = V[y] + v;
        } else if (!a2) {
          a2 = A[y];
          va2 = V[y] + v;
        }
      }
      p = mx1[x];
      if (mx1[y] + v == p) p = mx2[x];
      p = max(p, T[x]);
      if (V[y] + v + p != lp[A[y]]) {
        nm1 += num[y];
        if (!a1) {
          a1 = A[y];
          va1 = V[y] + v;
        } else if (!a3) {
          a3 = A[y];
          va3 = V[y] + v;
        }
      }
    }
  for (int i = 0; i < arr[x].size(); i++)
    if (arr[x][i].first != root) {
      int y = arr[x][i].first;
      int v = arr[x][i].second;
      if (mx1[y] + v == mx1[x]) {
        int p = mx2[x];
        p = max(p, T[x]);
        if (V[y] + v + p != lp[A[y]]) nm -= num[y];
        if (a != y)
          f4(y, x, a, va + v, nm);
        else
          f4(y, x, a2, va2 + v, nm);
        if (V[y] + v + p != lp[A[y]]) nm += num[y];
      } else {
        int p = mx1[x];
        p = max(p, T[x]);
        if (V[y] + v + p != lp[A[y]]) nm1 -= num[y];
        if (a != y)
          f4(y, x, a1, va1 + v, nm1);
        else
          f4(y, x, a3, va3 + v, nm1);
        if (V[y] + v + p != lp[A[y]]) nm1 += num[y];
      }
    }
}
void f3(int x, int root) {
  if (lp[x] != mx1[x] and a[x]) {
    num[x]++;
    A[x] = x;
  }
  for (int i = 0; i < arr[x].size(); i++)
    if (arr[x][i].first != root) {
      int y = arr[x][i].first;
      int v = arr[x][i].second;
      int p = mx1[x];
      if (p == mx1[y] + v) p = mx2[x];
      f3(y, x);
      Nm[x] += num[y];
      if (V[y] + v + p != lp[A[y]]) {
        num[x] += num[y];
        if (!A[x]) {
          A[x] = A[y];
          V[x] = V[y] + v;
        }
      }
    }
}
void f2(int x, int root, int t) {
  T[x] = t;
  lp[x] = max(t, mx1[x]);
  for (int i = 0; i < arr[x].size(); i++)
    if (arr[x][i].first != root) {
      int y = arr[x][i].first;
      int v = arr[x][i].second;
      int p = mx1[x];
      if (p == mx1[y] + v) p = mx2[x];
      f2(y, x, max(t, p) + v);
    }
}
void f1(int x, int root) {
  if (!a[x]) mx2[x] = mx3[x] = mx1[x] = -1000000007;
  for (int i = 0; i < arr[x].size(); i++)
    if (arr[x][i].first != root) {
      int y = arr[x][i].first;
      int v = arr[x][i].second;
      f1(y, x);
      if (mx1[x] < mx1[y] + v) {
        mx3[x] = mx2[x];
        mx2[x] = mx1[x];
        mx1[x] = mx1[y] + v;
      } else if (mx2[x] < mx1[y] + v) {
        mx3[x] = mx2[x];
        mx2[x] = mx1[y] + v;
      } else
        mx3[x] = max(mx3[x], mx1[y] + v);
    }
}
int main() {
  cin >> n >> m;
  int t1, t2;
  for (i = 1; i <= m; i++) {
    scanf("%d", &x);
    t2 = t1;
    t1 = x;
    a[x] = 1;
  }
  for (i = 1; i < n; i++) {
    scanf("%d %d %d", &x, &y, &z);
    arr[x].push_back(make_pair(y, z));
    arr[y].push_back(make_pair(x, z));
  }
  f1(1, 0);
  f2(1, 0, 0);
  f3(1, 0);
  f4(1, 0, 0, 0, 0);
  int mx = 0, s = 0;
  for (i = 1; i <= n; i++) {
    if (a[i]) continue;
    if (ans[i] > mx) {
      mx = ans[i];
      s = 1;
    } else if (ans[i] == mx)
      s++;
  }
  cout << mx << ' ' << s << '\n';
}
