int nThreads = Integer.parseInt(args[0]);
long n = Long.parseLong(args[1]);
int port = Integer.parseInt(args[3]);
CalcClient[] clients = new CalcClient[nThreads];
for (int i = 0; i < nThreads; i++) {
clients[i] = new CalcClient(n, args[2], port);
clients[i].start();
}
for (int i = 0; i < nThreads; i++) {
clients[i].join();
}