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 mox = 1e5 + 9;
vector<pair<int, int> > v[mox];
vector<int> g;
bool bl[mox];
int ha[mox];
bool ok[mox];
int dp[mox];
int ha2[mox];
int on[mox];
int dp2[mox];
int dp3[mox];
int t;
bool has[mox];
int p;
void dfs(int x, int dad = -1) {
  for (pair<int, int> i : v[x]) {
    if (ok[i.first] == 0 && i.first != dad) {
      ha[i.first] = ha[x] + i.second;
      dfs(i.first, x);
    }
  }
}
void dfs2(int x, int dad = -1) {
  ok[x] = 1;
  for (pair<int, int> i : v[x]) {
    if (i.first != dad) {
      dfs2(i.first, x);
      if (ok[i.first] == 0) ok[x] = 0;
    }
  }
  if (bl[x] == 1) ok[x] = 0;
}
void dfs3(int x, int dad = -1) {
  for (pair<int, int> i : v[x]) {
    if (ok[i.first] == 0 && i.first != dad) {
      dfs3(i.first, x);
      dp[x] += dp[i.first];
    }
  }
  if (bl[x] == 1) dp[x] += 1;
}
void dfs4(int x, int dad = -1) {
  int k;
  for (pair<int, int> i : v[x]) {
    if (ok[i.first] == 0 && i.first != dad) {
      dfs4(i.first, x);
      dp2[x] += dp2[i.first];
      dp3[x] += dp3[i.second];
      if (has[i.first] == 1) {
        has[x] = 1;
        k = i.first;
      }
    }
  }
  if (on[x] == 1) dp2[x] += 1;
  if (on[x] == 2) dp3[x] += 1;
  if (has[x] == 1) {
    dp[x] = dp2[x] + t - dp3[k];
  }
  if (x == p) has[x] = 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int x;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    g.push_back(a);
    x = a;
    bl[a] = 1;
  }
  for (int i = 0; i < (n - 1); i++) {
    int a, b, c;
    cin >> a >> b >> c;
    v[a].push_back({b, c});
    v[b].push_back({a, c});
  }
  dfs2(x);
  dfs(x);
  x = max_element(ha, ha + n + 1) - ha;
  memset(ha, 0, sizeof(ha));
  dfs(x);
  int y = max_element(ha, ha + n + 1) - ha;
  for (int i = 1; i <= n; i++) {
    ha2[i] = ha[i];
  }
  memset(ha, 0, sizeof(ha));
  dfs(y);
  p = x;
  for (int i = 1; i <= n; i++) {
    if (ha[i] > ha2[i] && bl[i]) on[i] = 1;
    if (ha2[i] > ha[i] && bl[i]) {
      on[i] = 2;
      t++;
    }
  }
  dfs4(y);
  dfs3(y);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (bl[i] == 0) ans = max(ans, dp[i]);
  }
  cout << ans << " ";
  int s = 0;
  for (int i = 1; i <= n; i++) {
    if (bl[i] == 0) {
      if (ans == dp[i]) s++;
    }
  }
  cout << s;
}
