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 maxn = 100000 + 100;
const int maxlog = 17 + 1;
int n, m;
bool good[maxn];
vector<pair<int, int> > adj[maxn];
vector<pair<int, int> > childs[maxn];
bool mark[maxn];
pair<int, int> down[maxn];
pair<int, int> glob[maxn];
int par[maxlog][maxn];
int dep[maxn];
int val[maxn];
pair<int, int> combine(pair<int, int> p, pair<int, int> q, int v) {
  if (p.first == -1 && q.first == -1) return pair<int, int>(-1, 0);
  if (p.first == -1) return q;
  if (q.first == -1) return p;
  if (p.second == q.second) return pair<int, int>(v, p.second);
  return (p.second < q.second) ? q : p;
}
void dfs_down(int v, int parent = 0, int depth = 0) {
  mark[v] = true;
  down[v] = pair<int, int>(good[v] ? v : -1, 0);
  dep[v] = depth;
  par[0][v] = parent;
  for (int i = (int)(1), _n = (int)(maxlog); i < _n; i++)
    par[i][v] = par[i - 1][par[i - 1][v]];
  for (pair<int, int> uw : adj[v])
    if (!mark[uw.first]) {
      int u = uw.first, w = uw.second;
      childs[v].push_back(uw);
      dfs_down(u, v, depth + 1);
      down[v] = combine(down[v],
                        pair<int, int>(down[u].first, down[u].second + w), v);
    }
}
void dfs_glob(int v, pair<int, int> up = pair<int, int>(-1, 0)) {
  glob[v] = combine(up, down[v], v);
  pair<int, int> cur = (good[v] ? pair<int, int>(v, 0) : pair<int, int>(-1, 0));
  vector<pair<int, int> > left;
  for (pair<int, int> uw : childs[v]) {
    int u = uw.first, w = uw.second;
    left.push_back(cur);
    cur = combine(cur, pair<int, int>(down[u].first, down[u].second + w), v);
  }
  for (int i = (int)((int((childs[v]).size()))), _x = (int)(0); i-- > _x;) {
    int u = childs[v][i].first, w = childs[v][i].second;
    pair<int, int> tmp = combine(up, left[i], v);
    dfs_glob(u, pair<int, int>(tmp.first, tmp.second + w));
    up = combine(up, pair<int, int>(down[u].first, down[u].second + w), v);
  }
}
int lca(int v, int u) {
  if (dep[v] > dep[u]) swap(v, u);
  for (int i = (int)(maxlog), _x = (int)(0); i-- > _x;)
    if (dep[v] <= dep[u] - (1 << i)) u = par[i][u];
  for (int i = (int)(maxlog), _x = (int)(0); i-- > _x;)
    if (par[i][v] != par[i][u]) v = par[i][v], u = par[i][u];
  return v == u ? v : par[0][v];
}
void relax(int v) {
  for (pair<int, int> uw : childs[v]) {
    relax(uw.first);
    val[v] += val[uw.first];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0, _n = (int)(m); i < _n; i++) {
    int x;
    cin >> x;
    x--;
    good[x] = true;
  }
  for (int i = 0, _n = (int)(n - 1); i < _n; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    adj[u].push_back(pair<int, int>(v, w));
    adj[v].push_back(pair<int, int>(u, w));
  }
  dfs_down(0);
  dfs_glob(0);
  for (int v = 0, _n = (int)(n); v < _n; v++)
    if (good[v]) {
      int u = lca(v, glob[v].first);
      val[v]++;
      val[glob[v].first]++;
      val[u]--;
      if (u != 0) val[par[0][u]]--;
      ;
    }
  relax(0);
  pair<int, int> ans = pair<int, int>(-1, 0);
  for (int i = 0, _n = (int)(n); i < _n; i++)
    if (!good[i] && ans.first <= val[i])
      ans = pair<int, int>(val[i], ans.first == val[i] ? ans.second + 1 : 1);
  cout << ans.first << ' ' << ans.second << endl;
  {
    int _;
    cin >> _;
    return 0;
  }
}
