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 long long MOD = 1e9 + 7;
const int INF = 1e9;
const long long INF64 = 1e18;
const double EPS = 1e-9;
const double PI = acos(-1);
const long long MD = 1951513443;
const long long T = 26;
const int N = 200100;
const int M = 340;
int n, m, tin[N], tout[N], timer;
long long in[N], out[N], ans[N], zz[N];
vector<int> top;
pair<int, pair<int, int> > dp[N];
bool mark[N];
vector<pair<int, int> > g[N];
void upd(int v, int u) {
  in[v]++;
  out[u]++;
}
void dfs1(int v, int p) {
  tin[v] = timer++;
  top.push_back(v);
  dp[v] = make_pair(0, make_pair(v, v));
  if (!mark[v]) dp[v].first = -1;
  for (int i = 0; i < int(int((g[v]).size())); i++) {
    int u = g[v][i].first, w = g[v][i].second;
    if (u == p) continue;
    dfs1(u, v);
    if (dp[u].first != -1 && dp[u].first + w > dp[v].first) {
      dp[v] = dp[u];
      dp[v].second.second = v;
      dp[v].first += w;
    } else if (dp[u].first != -1 && dp[u].first + w == dp[v].first) {
      dp[v].second.first = v;
    }
  }
  tout[v] = timer++;
  top.push_back(v);
}
void push_v(vector<pair<int, pair<int, int> > > &a,
            pair<int, pair<int, int> > v) {
  if (int((a).size()) < 3) {
    a.push_back(v);
    int i = int((a).size()) - 1;
    while (i > 0) {
      if (a[i] > a[i - 1])
        swap(a[i], a[i - 1]);
      else
        break;
      i--;
    }
  } else {
    if (v > a[2]) {
      a[2] = v;
      int i = 2;
      while (i > 0) {
        if (a[i] > a[i - 1])
          swap(a[i], a[i - 1]);
        else
          break;
        i--;
      }
    }
  }
}
void dfs2(int v, int p, pair<int, pair<int, int> > z) {
  vector<pair<int, pair<int, int> > > a;
  for (int i = 0; i < int(int((g[v]).size())); i++) {
    int u = g[v][i].first, w = g[v][i].second;
    if (u == p) continue;
    if (dp[u].first != -1) push_v(a, make_pair(dp[u].first + w, dp[u].second));
  }
  if (mark[v]) {
    if (int((a).size()) == 0) {
      if (z.first > 0) {
        upd(z.second.first, p);
        upd(z.second.first, z.second.second);
        zz[z.second.first]++;
      }
    } else {
      if (z.first > a[0].first) {
        upd(z.second.first, p);
        upd(z.second.first, z.second.second);
        zz[z.second.first]++;
      } else if (z.first < a[0].first &&
                 (int((a).size()) == 1 || a[0].first > a[1].first)) {
        upd(v, a[0].second.first);
      }
    }
  }
  if (mark[v] && z.first < 0) z = make_pair(0, make_pair(v, v));
  for (int i = 0; i < int(int((g[v]).size())); i++) {
    int u = g[v][i].first, w = g[v][i].second;
    if (u == p) continue;
    pair<int, pair<int, int> > zz = z;
    int k = 0;
    for (int i = 0; i < int(min(3, int((a).size()))); i++)
      if (a[i].second.second != u) {
        if (a[i].first == zz.first) {
          zz = make_pair(zz.first, make_pair(v, v));
        }
        if (a[i].first > zz.first) {
          zz = make_pair(a[i].first, make_pair(v, a[i].second.first));
        }
      }
    if (zz.first != -1) zz.first += w;
    dfs2(u, v, zz);
  }
}
long long dfs3(int v, int p) {
  long long sum = 0;
  for (int i = 0; i < int(int((g[v]).size())); i++) {
    int u = g[v][i].first, w = g[v][i].second;
    if (u == p) continue;
    sum += dfs3(u, v);
  }
  sum += out[v];
  ans[v] = sum - zz[v];
  sum -= in[v] + zz[v];
  return sum;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < int(m); i++) {
    int first;
    scanf("%d", &first);
    mark[first] = 1;
  }
  for (int i = 0; i < int(n - 1); i++) {
    int first, second, z;
    scanf("%d %d %d", &first, &second, &z);
    g[first].push_back(make_pair(second, z));
    g[second].push_back(make_pair(first, z));
  }
  dfs1(1, -1);
  dfs2(1, -1, make_pair(-1, make_pair(-1, -1)));
  dfs3(1, -1);
  long long maxi = -1, kk = 0;
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      if (ans[i] > maxi) {
        maxi = ans[i];
        kk = 1;
      } else if (ans[i] == maxi)
        kk++;
    }
  cout << maxi << ' ' << kk << endl;
  return 0;
}
