var
  m,n,i,j,t,k,min : longint;
  a,b         : array[1..10000] of integer;
  s           : int64;
begin
  assign(input,'E.in');  reset(input);
  assign(output,'E.out'); rewrite(output);

  read(n,m);
  for i:=1 to n do
    read(a[i]);
  for i:=1 to m do
    read(b[i]);

  s := 0;
  if (m<n) then
    begin
      write(m,' ');
      k := 0;
      while (k<m) do
        begin
          min := 100000;
          for i:=1 to n do
            if (min>a[i]) and (a[i]<>-1) then
             begin
               t := i;
               min := a[i];
             end;
          s := s+min;
          a[t] := -1;
          inc(k);
        end;
      for i:=1 to m do
        s := s+b[m];
      write(s);
    end
  else
    begin
      s := 0;
      write(n,' ');
      k := 0;
      while (k<n) do
        begin
          inc(k);
          min := 100000;
          for i:=1 to m do
            if (b[i]< min) and (b[i]<>-1) then
              begin
                min := b[i];
                t := i;
              end;
          s := s+min;
          b[t] := -1;
        end;
      for i:=1 to n do
        s:=s+a[i];
      write(s);
    end;

  close(input);  close(output);
end.