Parallel activities after retry treat as success

Hello,

I have 3 activities to be called in parallel using Async . WF should be failed only if actvity1 and activity2 failed after n retries whereas activity 3 and activity4 should be treated as success after n retries.
what would be the best way ti implement this solution. Each activity has it own retry policy
Promise actvity1= Async.function(() → {
});

Promise actvity2= Async.function(() → {
});

Promise actvity3= Async.function(() → {
});

Promise actvity4= Async.function(() → {
});

activity1.get();
activity2.get();
try {
    activity3.get();
} catch (ActivityFailure e) {
  // ignore failure
}
try {
    activity4.get();
} catch (ActivityFailure e) {
  // ignore failure
}

Thanks @maxim in case if activity 1 or 2 fails before activity 4 or 5 being called, WF throws error and activity 3 or 4 is never called. is there a way to complete these activities

ActivityFailure failure = null;
try {
    activity1.get();
    activity2.get();
} catch(Exception e) {
    failure = e;
}
try {
    activity3.get();
} catch (ActivityFailure e) {
  // ignore failure
}
try {
    activity4.get();
} catch (ActivityFailure e) {
  // ignore failure
}
if (failure != null) {
   throw failure;
}